2011-01-26 47 views
0

所以,我有一个非常简单的代码的小项目。它真正做的是用下面的方式创建一个wxFrame:wxWidgets defaultlib'MSVCRT'冲突问题

wxFrame(NULL, -1, title, wxPoint(-1, -1), wxSize(380, 220)) 

没有任何编译问题,我的任何代码。问题occures当我做这一行:

IMPLEMENT_APP(App); 

应用程序是:

class App: public wxApp 

所以,当我做到这一点,我打编译,我有以下错误:

 
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library 
1>CApp.obj : warning LNK4248: unresolved typeref token (01000019) for 'wxVideoMode'; image may not run 
1>CLoadingFrame.obj : warning LNK4248: unresolved typeref token (01000019) for 'wxToolTip'; image may not run 
1>CLoadingFrame.obj : warning LNK4248: unresolved typeref token (0100001A) for 'wxDropTarget'; image may not run 
1>CLoadingFrame.obj : error LNK2020: unresolved token (0A000DB2) "int g_isPainting" ([email protected]@3HA) 
1>CApp.obj : error LNK2020: unresolved token (0A000DBE) "int g_isPainting" ([email protected]@3HA) 
1>CLoadingFrame.obj : error LNK2028: unresolved token (0A000DB4) "void __cdecl wxOnAssert(char const *,int,char const *,char const *,char const *)" ([email protected]@[email protected]) referenced in function "protected: void __thiscall wxShadowObjectFields_wxImplementation_HashTable::ResizeTable(unsigned int)" ([email protected][email protected]@[email protected]) 
1>CApp.obj : error LNK2028: unresolved token (0A000DC0) "void __cdecl wxOnAssert(char const *,int,char const *,char const *,char const *)" ([email protected]@[email protected]) referenced in function "protected: void const * __thiscall wxVectorBase::GetItem(unsigned int)const " ([email protected]@@[email protected]) 
1>CApp.obj : error LNK2019: unresolved external symbol "void __cdecl wxOnAssert(char const *,int,char const *,char const *,char const *)" ([email protected]@[email protected]) referenced in function "protected: void const * __thiscall wxVectorBase::GetItem(unsigned int)const " ([email protected]@@[email protected]) 
1>CLoadingFrame.obj : error LNK2001: unresolved external symbol "void __cdecl wxOnAssert(char const *,int,char const *,char const *,char const *)" ([email protected]@[email protected]) 
1>CApp.obj : error LNK2001: unresolved external symbol "int g_isPainting" ([email protected]@3HA) 
1>CLoadingFrame.obj : error LNK2001: unresolved external symbol "int g_isPainting" ([email protected]@3HA) 
1>CApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsole::OnAssertFailure(char const *,int,char const *,char const *,char const *)" ([email protected]@@[email protected]) 
1>CApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsole::OnAssert(char const *,int,char const *,char const *)" ([email protected]@@[email protected]) 
1>D:\WickedLauncher\WickedLauncherv2\Debug\WickedLauncherv2.exe : fatal error LNK1120: 8 unresolved externals 

我将不胜感激任何帮助!

问候。

+0

看起来你正在使用C++和Visual Studio。那是对的吗?你正在做一个调试或发布版本?你检查过所有的wxWidgets库是否匹配(调试或发布)?你是说如果你评论出IMPLEMENT_APP(App);你的应用程序链接成功 – ravenspoint 2011-02-01 16:32:29

回答

0

其中定义了g_isPainting?

您是否向wxAppConsole的链接器添加了正确的库?

+0

我没有定义g_isPainting,所以它必须在wxWidgets中。 “你把什么是正确的库添加到链接器”。我按照文档所述配置了所有内容。我已经编译了可以正常工作的东西。 – OneShotKillah 2011-01-26 13:33:31