debug模式编译通过,但release模式不通过。OnExit,OnClear,OnStop,OnStart是工具栏的按钮命令函数,参照其他工程,我自己加上去的。
CreateExToolBar是普通定义的方法,放到int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)中调用。--------------------Configuration: Server - Win32 Release--------------------
Compiling...
MainFrm.cpp
Server.cpp
Generating Code...
Linking...
MainFrm.obj : error LNK2001: unresolved external symbol "protected: void __thiscall CMainFrame::OnExit(void)" (?OnExit@CMainFrame@@IAEXXZ)
MainFrm.obj : error LNK2001: unresolved external symbol "protected: void __thiscall CMainFrame::OnClear(void)" (?OnClear@CMainFrame@@IAEXXZ)
MainFrm.obj : error LNK2001: unresolved external symbol "protected: void __thiscall CMainFrame::OnStop(void)" (?OnStop@CMainFrame@@IAEXXZ)
MainFrm.obj : error LNK2001: unresolved external symbol "protected: void __thiscall CMainFrame::OnStart(void)" (?OnStart@CMainFrame@@IAEXXZ)
MainFrm.obj : error LNK2001: unresolved external symbol "public: int __thiscall CMainFrame::CreateExToolBar(void)" (?CreateExToolBar@CMainFrame@@QAEHXZ)
Release/Server.exe : fatal error LNK1120: 5 unresolved externals
Error executing link.exe.Server.exe - 6 error(s), 0 warning(s)不明白为什么这样。

解决方案 »

  1.   

    有没有 #ifdef __DEBUG__...这样的控制代码?
    CMainFrame::OnExit等函数实现部分是在MainFrm.cpp中吗?
      

  2.   

    看看是不是被条件编译了,函数没有在#ifdef...#endif之间吧
      

  3.   

    CMainFrame::OnExit等函数实现部分是在MainFrm.cpp中。
      

  4.   

    咳,原来真是放在了#ifdef...#endif之间。
    多谢了。
    等阵结贴。