[英]Reference errors when linking wxWidgets statically
I'm using this Premake4 script for wxWidgets in my build script: 我在构建脚本中为wxWidgets使用了这个Premake4脚本:
wx_config {Unicode="yes", Version="2.9", Libs="core,aui,media,html", WindowsCompiler="gcc", Static="yes"}
But CodeBlocks respectively MinGW outputs many errors: 但是CodeBlocks分别MinGW会输出很多错误:
wx\lib\gcc_lib/libwxbase29u.a(baselib_filename.o):filename.cpp:(.text+0x5371): undefined reference to `CoCreateInstance@20'
wx\lib\gcc_lib/libwxbase29u.a(baselib_filename.o):filename.cpp:(.text+0x5390): undefined reference to `IID_IPersistFile'
wx\lib\gcc_lib/libwxmsw29u_core.a(corelib_window.o):window.cpp:(.text+0x7cc9): undefined reference to `wxEVT_POWER_SUSPEND_CANCEL'
wx\lib\gcc_lib/libwxmsw29u_core.a(corelib_window.o):window.cpp:(.text+0x7cf9): undefined reference to `vtable for wxPowerEvent'
wx\lib\gcc_lib/libwxmsw29u_core.a(corelib_window.o):window.cpp:(.text+0x7d55): undefined reference to `wxEVT_POWER_SUSPENDED'
wx\lib\gcc_lib/libwxmsw29u_core.a(corelib_window.o):window.cpp:(.text+0x7d61): undefined reference to `wxEVT_POWER_SUSPENDING'
wx\lib\gcc_lib/libwxmsw29u_core.a(corelib_window.o):window.cpp:(.text+0x7d6d): undefined reference to `wxEVT_POWER_RESUME'
wx\lib\gcc_lib/libwxmsw29u_core.a(corelib_window.o):window.cpp:(.text+0x7f18): undefined reference to `vtable for wxPowerEvent'
...
You can see all linker errors here: http://pastebin.com/UGSRg4DX 您可以在此处查看所有链接器错误: http : //pastebin.com/UGSRg4DX
Someone mentioned in a wxWidgets bug report (link lost) that the library order is causing this problem. 有人在wxWidgets错误报告(链接丢失)中提到库顺序导致了这个问题。 But he didn't say which library has to be put first. 但他没有说哪个库必须先放。
This looks like exactly the same problem as this one . 这看起来完全一样的问题,因为这一个 。 Ie you need to put the libraries in your premake script in the right order: aui,media,html,core
(the important thing is that "core" is the last one). 即你需要以正确的顺序将库放在你的预制脚本中: aui,media,html,core
(重要的是“核心”是最后一个)。 Also, I don't know if it's appended implicitly perhaps but normally you'd also need "base" at the very end. 另外,我不知道它是否隐含地附加了,但通常你最后也需要“基础”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.