编译简单项目时出错

时间:2013-07-11 09:11:44

标签: compiler-errors wxwidgets codeblocks undefined-reference mingw-w64

我正在尝试使用wxWidgets 64位(2.8.12)在CodeBlocks(12.11)中编译一个项目,我收到了这个错误:

undefined reference to `__imp_z22wxInitAllImageHandlersv'|
undefined reference to `__imp_ZN12wxAppConsole17CheckBuildOptionsEPKcS1_'|
undefined reference to `__imp_ZN5wxAppC2Ev'|
undefined reference to `__imp_ZN12wxAppConsole14ms_appInstanceE'|
undefined reference to `__imp_Z7wxEntryP11HINSTANCE__50_Pci'|

我该如何解决这个问题?

PS:wxWidgets库编译正确,CodeBlocks识别它。

修改

-------------- Build: Release in amdwx (compiler: MinGW64)---------------

g++.exe -LC:\wxWidgets-2.8.12\lib\gcc_dll  -o bin\Release\amdwx.exe obj\Release\amdwxApp.o obj\Release\amdwxMain.o  obj\Release\resource.res  -s -mthreads  C:\wxWidgets-2.8.12\lib\gcc_dll\libwxmsw28u.a  -mwindows
obj\Release\amdwxApp.o:amdwxApp.cpp:(.text+0x5d): undefined reference to `__imp__Z22wxInitAllImageHandlersv'
obj\Release\amdwxApp.o:amdwxApp.cpp:(.text+0x173): undefined reference to `__imp__ZN12wxAppConsole17CheckBuildOptionsEPKcS1_'
obj\Release\amdwxApp.o:amdwxApp.cpp:(.text+0x193): undefined reference to `__imp__ZN5wxAppC2Ev'
obj\Release\amdwxApp.o:amdwxApp.cpp:(.text+0x1f3): undefined reference to `__imp__ZN12wxAppConsole14ms_appInstanceE'
obj\Release\amdwxApp.o:amdwxApp.cpp:(.text+0x203): undefined reference to `__imp__Z7wxEntryP11HINSTANCE__S0_Pci'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: obj\Release\amdwxApp.o: bad reloc address 0x0 in section `.pdata$_ZN12wxEvtHandler12TryValidatorER7wxEvent'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 7 seconds)
5 errors, 0 warnings (0 minutes, 7 seconds)

我的项目中有以下文件:

pastebin.com/iDDbpUQ5 - > amdwxMain.h

pastebin.com/jk47hHVY - > amdwxMain.cpp

pastebin.com/KP9e5AzB - > amdwxApp.h

pastebin.com/x57pBLHZ - > amdwxApp.cpp

我发布了pastebin服务器,因为文件太多了。

0 个答案:

没有答案