如何正确linkwxWidget静态库在Code::blocks?

How to correctly link wxWidget static libraries in Code::blocks?

在编译 wxwidget 项目时,我得到了对“XXXXXXXXXX”的多个(160+)未定义引用, https://wiki.wxwidgets.org/Compiling_wxWidgets_with_MinGW#undefined_reference

your static libs MUST be given before shared libs.

"-lwx_mswXXXXXX" and "XXXXXXXXXXX/libXXXXXX.a"

我在这个项目中没有共享库。

我使用这个命令构建了 wxwidget 3.1.1 库:

mingw32-make SHELL=CMD.exe -j4 -f makefile.gcc BUILD=release UNICODE=1 SHARED=0

我正在使用 mingw 发行版 (nuwen) gcc 7.3.0 版和代码块 17.02

我在代码块中使用 wxwidget 向导设置项目。 我之前尝试过虚拟源代码,它在使用共享库构建时工作。

我链接了项目>构建选项>链接器设置中的所有库:

搜索目录是: 编译器:C:\wxWidgets-3.1.1\lib\gcc_lib\mswu 链接器:C:\wxWidgets-3.1.1\lib\gcc_lib 资源编译器:C:\wxWidgets-3.1.1\lib\gcc_lib\mswu

这里是构建日志:

-------------- Build: Release in test (compiler: GNU GCC Compiler)---------------

g++.exe -LC:\wxWidgets-3.1.1\lib\gcc_lib -o bin\Release\test.exe  obj\Release\testApp.o obj\Release\testMain.o obj\Release\resource.res -s -static-libstdc++ -static-libgcc -static -mthreads  -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -lshlwapi -lversion -lwxmsw31u_richtext -lwxmsw31u_xrc -lwxmsw31u_aui -lwxmsw31u_media -lwxbase31u_net -lwxmsw31u_gl -lwxbase31u_xml -lwxmsw31u_adv -lwxmsw31u_html -lwxmsw31u_core -lwxbase31u -lwxpng -lwxjpeg -lwxtiff -lwxzlib -lwxregexu -lwxexpat -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -lshlwapi -lversion -mwindows
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0xc1e1): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0xc205): undefined reference to `__imp_GetThemeColor'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0xc266): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0xc7c1): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0xc874): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x10459): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x104bd): undefined reference to `__imp_GetThemeBackgroundContentRect'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x10520): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x10c7a): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x10cfe): undefined reference to `__imp_GetThemeBackgroundContentRect'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x10d53): undefined reference to `__imp_IsThemeBackgroundPartiallyTransparent'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x10d6e): undefined reference to `__imp_DrawThemeParentBackground'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x10da5): undefined reference to `__imp_DrawThemeBackground'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x10dd2): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x117d7): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_window.o):window.cpp:(.text+0x118ba): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_anybutton.o):anybutton.cpp:(.text+0x8c0): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_anybutton.o):anybutton.cpp:(.text+0x8f0): undefined reference to `__imp_GetThemeMargins'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_anybutton.o):anybutton.cpp:(.text+0x930): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_anybutton.o):anybutton.cpp:(.text+0x946): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_anybutton.o):anybutton.cpp:(.text+0x3fd3): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_anybutton.o):anybutton.cpp:(.text+0x4008): undefined reference to `__imp_IsThemeBackgroundPartiallyTransparent'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_anybutton.o):anybutton.cpp:(.text+0x402b): undefined reference to `__imp_DrawThemeParentBackground'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_anybutton.o):anybutton.cpp:(.text+0x405a): undefined reference to `__imp_DrawThemeBackground'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_anybutton.o):anybutton.cpp:(.text+0x4089): undefined reference to `__imp_GetThemeMargins'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_anybutton.o):anybutton.cpp:(.text+0x40d7): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_anybutton.o):anybutton.cpp:(.text+0x663f): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x51e): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x539): undefined reference to `__imp_GetThemeSysColor'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x571): undefined reference to `__imp_GetThemeSysColor'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x5b3): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x658): undefined reference to `__imp_GetThemeSysColor'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x6d5): undefined reference to `__imp_GetThemeSysColor'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x757): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x1ff7): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x2025): undefined reference to `__imp_GetThemeMargins'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x20ed): undefined reference to `__imp_GetThemePartSize'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x2174): undefined reference to `__imp_GetThemeInt'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x2199): undefined reference to `__imp_GetThemeSysFont'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x22d1): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x2ef8): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x37a3): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x380e): undefined reference to `__imp_DrawThemeBackground'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x38a5): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x3bc6): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x4768): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x477c): undefined reference to `__imp_IsThemeBackgroundPartiallyTransparent'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x478b): undefined reference to `__imp_DrawThemeBackground'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x47fa): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x4b7a): undefined reference to `__imp_DrawThemeBackground'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x4d37): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_menuitem.o):menuitem.cpp:(.text+0x505e): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_statbox.o):statbox.cpp:(.text+0x2d60): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_statbox.o):statbox.cpp:(.text+0x2d91): undefined reference to `__imp_GetThemeFont'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_statbox.o):statbox.cpp:(.text+0x2db7): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_statbox.o):statbox.cpp:(.text+0x2ed2): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_statusbar.o):statusbar.cpp:(.text+0x1a10): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_statusbar.o):statusbar.cpp:(.text+0x1a3e): undefined reference to `__imp_GetThemeBackgroundContentRect'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_statusbar.o):statusbar.cpp:(.text+0x1a75): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_statusbar.o):statusbar.cpp:(.text+0x237d): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x4bd): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x4d6): undefined reference to `__imp_IsThemePartDefined'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x4f8): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x53e): undefined reference to `__imp_GetThemePartSize'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x567): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x60f): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x6b5): undefined reference to `__imp_DrawThemeBackground'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x712): undefined reference to `__imp_GetThemeBackgroundContentRect'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x7c2): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x8c9): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x931): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x945): undefined reference to `__imp_IsThemePartDefined'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x9a2): undefined reference to `__imp_GetThemePartSize'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x9ef): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0xa38): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0xa81): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0xabd): undefined reference to `__imp_IsThemePartDefined'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0xb14): undefined reference to `__imp_IsThemeBackgroundPartiallyTransparent'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0xb51): undefined reference to `__imp_DrawThemeParentBackground'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0xbae): undefined reference to `__imp_DrawThemeBackground'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0xbf6): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0xc91): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0xcf6): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0xd26): undefined reference to `__imp_IsThemePartDefined'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0xdb7): undefined reference to `__imp_DrawThemeBackground'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0xe01): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0xe3b): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0xfd6): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x1095): undefined reference to `__imp_DrawThemeBackground'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x10ba): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x111d): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x11b6): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x11f6): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x12a4): undefined reference to `__imp_DrawThemeBackground'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x12c9): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x132d): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x1395): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x14bf): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x151e): undefined reference to `__imp_GetThemeColor'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x17d2): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x1848): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x1963): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x1a1b): undefined reference to `__imp_DrawThemeBackground'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x1bb6): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x1ca5): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x24d1): undefined reference to `__imp_DrawThemeBackground'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x2630): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x266a): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x2693): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x26d9): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x273d): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x27b7): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x2823): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x2b27): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x2b81): undefined reference to `__imp_IsThemePartDefined'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x2be1): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_renderer.o):renderer.cpp:(.text+0x33c8): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_uxtheme.o):uxtheme.cpp:(.text+0x6): undefined reference to `__imp_IsAppThemed'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_uxtheme.o):uxtheme.cpp:(.text+0x12): undefined reference to `__imp_IsThemeActive'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_combo.o):combo.cpp:(.text+0xf3f): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_combo.o):combo.cpp:(.text+0x1249): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_combo.o):combo.cpp:(.text+0x1849): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_combo.o):combo.cpp:(.text+0x1aa9): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_combo.o):combo.cpp:(.text+0x1c01): undefined reference to `__imp_IsThemeBackgroundPartiallyTransparent'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_combo.o):combo.cpp:(.text+0x1c31): undefined reference to `__imp_DrawThemeParentBackground'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_combo.o):combo.cpp:(.text+0x1c6d): undefined reference to `__imp_DrawThemeBackground'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_combo.o):combo.cpp:(.text+0x1cbd): undefined reference to `__imp_DrawThemeBackground'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_combo.o):combo.cpp:(.text+0x1d85): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_combo.o):combo.cpp:(.text+0x22c9): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_notebook.o):notebook.cpp:(.text+0x1861): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_notebook.o):notebook.cpp:(.text+0x18c1): undefined reference to `__imp_GetThemeBackgroundExtent'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_notebook.o):notebook.cpp:(.text+0x1918): undefined reference to `__imp_DrawThemeBackground'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_notebook.o):notebook.cpp:(.text+0x1968): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_notebook.o):notebook.cpp:(.text+0x19cd): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_notebook.o):notebook.cpp:(.text+0x1e56): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_notebook.o):notebook.cpp:(.text+0x1e87): undefined reference to `__imp_GetThemeColor'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_notebook.o):notebook.cpp:(.text+0x1f78): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_notebook.o):notebook.cpp:(.text+0x2008): undefined reference to `__imp_GetCurrentThemeName'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_notebook.o):notebook.cpp:(.text+0x2294): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_notebook.o):notebook.cpp:(.text+0x30a5): undefined reference to `__imp_SetWindowTheme'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_notebook.o):notebook.cpp:(.text+0x6760): undefined reference to `__imp_OpenThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_notebook.o):notebook.cpp:(.text+0x67a0): undefined reference to `__imp_GetThemeBackgroundExtent'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_notebook.o):notebook.cpp:(.text+0x67c3): undefined reference to `__imp_DrawThemeBackground'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_notebook.o):notebook.cpp:(.text+0x67d1): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_msw_notebook.o):notebook.cpp:(.text+0x67eb): undefined reference to `__imp_CloseThemeData'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_access.o):access.cpp:(.text+0x1e9): undefined reference to `CreateStdAccessibleObject'
C:\wxWidgets-3.1.1\lib\gcc_lib\libwxmsw31u_core.a(corelib_systhemectrl.o):systhemectrl.cpp:(.text+0x4f): undefined reference to `__imp_SetWindowTheme'
collect2.exe: error: ld returned 1 exit status

当您使用代码块向导创建 wxWidgets 项目时,配置选项必须与您用于构建 wxWidgets 库的选项相匹配。既然你说你是用选项构建的

UNICODE=1 SHARED=0

向导中的选项应如下所示:

此外,codeblocks 向导不会添加与 wxWidgets 3.1.1 静态链接所需的 2 个库。所以你需要像这样手动添加 libuxtheme.a 和 liboleacc.a:

(截至 2018 年 4 月 22 日,这是正确的,但希望该向导能尽快得到修补。)