Reputation: 29414
I'm using this Premake4 script for wxWidgets in my build script:
wx_config {Unicode="yes", Version="2.9", Libs="core,aui,media,html", WindowsCompiler="gcc", Static="yes"}
But CodeBlocks respectively MinGW outputs many errors:
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
Someone mentioned in a wxWidgets bug report(link lost) that the library order is causing this problem. But he didn't say which library has to be put first.
Upvotes: 0
Views: 3829
Reputation: 9
MinGW Compiler is not well suited for wxwidgets. Even I have tried to compile my project with MinGW GCC compiler. But I can get success after so much of attempts.
Same thing I have done with TDM-GCC compiler first. Latter I tried with MSYS64 compiler also. And results was fine.
Both of them were able to compile the project.
So I will suggest you to use any of compiler than except MinGW.
Upvotes: 0
Reputation: 22678
This looks like exactly the same problem as this one. I.e. 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). Also, I don't know if it's appended implicitly perhaps but normally you'd also need "base" at the very end.
Upvotes: 2