我新建了一个对话框,对这个对话框建立了一个类在对话框里面定义了几个按钮,对其中的一些按钮建立了命令响应函数,编译后可以成功运行我关闭VC后,重新打开这个工作空间,编译时它报错:--------------------Configuration: Mybole2 - Win32 Debug--------------------
Linking...
Mybole2View.obj : error LNK2001: unresolved external symbol "public: __thiscall CTestDlg::CTestDlg(class CWnd *)" (??0CTestDlg@@QAE@PAVCWnd@@@Z)
Debug/Mybole2.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.Mybole2.exe - 1 error(s), 0 warning(s)
试了好多次都是这样,不知道为什么?
谁能帮帮我。。谢谢哈

解决方案 »

  1.   

    Mybole2View.obj : error LNK2001: unresolved external symbol "public: __thiscall CTestDlg::CTestDlg(class CWnd *)" (??0CTestDlg@@QAE@PAVCWnd@@@Z)
    Debug/Mybole2.exe : fatal error LNK1120: 1 unresolved externals------------------------------------------
    这句话的意思是,代码中并没有语法错误,但是在链接目标文件的时候,在其他目标文件中没有找到这个函数:public: __thiscall CTestDlg::CTestDlg(class CWnd *)" 。
    而你当前的这个模块(Mybole2View.obj)中一定在某处调用了这个函数。你自己检查一下。