我最近开始在 Code::Blocks 10.05 上使用 wxSmith 在 GUI 上工作,当我运行项目时,我还没有编写任何代码,只是 OnClose 函数,当我构建并运行我的项目时,我得到 4错误、cannot find -lwxmsw28d_core
、cannot find -lwxbase28d
、cannot find -lwxpngd
和cannot find -lwxzlibd
。构建日志是:
-------------- Build: Debug in gui-test ---------------
Compiling: gui_testMain.cpp
Linking executable: bin\Debug\gui-test.exe
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib/libwxmsw28d_core.a when searching for -lwxmsw28d_core
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d_core.a when searching for -lwxmsw28d_core
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib/libwxmsw28d_core.a when searching for -lwxmsw28d_core
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwxmsw28d_core
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib/libwxbase28d.a when searching for -lwxbase28d
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxbase28d.a when searching for -lwxbase28d
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib/libwxbase28d.a when searching for -lwxbase28d
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwxbase28d
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib/libwxpngd.a when searching for -lwxpngd
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxpngd.a when searching for -lwxpngd
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib/libwxpngd.a when searching for -lwxpngd
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwxpngd
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib/libwxzlibd.a when searching for -lwxzlibd
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxzlibd.a when searching for -lwxzlibd
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib/libwxzlibd.a when searching for -lwxzlibd
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwxzlibd
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
4 errors, 0 warnings
什么可能给我错误?我在 Windows 上使用 Code::Blocks。我正在做这个链接在做什么的教程wxSmith Tutorial - Code::Blocks Wiki
注意:如果有帮助,我从 wxPack 安装了 wxWidgets,在 Code::Blocks 中,我使用全局变量编辑器创建了一个全局变量,其中基本字段有C:\SourceCode\Libraries\wxWidgets2.8
,包含字段有C:\SourceCode\Libraries\wxWidgets2.8\include
,lib 字段有C:\SourceCode\Libraries\wxWidgets2.8\lib
。其余字段为空,如 obj(我找不到 obj 文件夹)、cflags、lflags 和用户定义字段为空。