Hello everyone.
I think this topic is like a boomerang - it always comes back :( sorry for this but I spent all day and I am going nuts. I've read a lot of posts on forum.
I am using Code:Blocks SVN 4893, windows Vista, mingw 5.1.4, gcc
ok, I have wxWidgets 2.8.8, build like:
mingw32-make -f makefile.gcc USE_XRC=1 MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=debug USE_OPENGL=1
mingw32-make -f makefile.gcc USE_XRC=1 MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=release USE_OPENGL=1
mingw32-make -f makefile.gcc USE_XRC=1 MONOLITHIC=1 SHARED=0 UNICODE=1 BUILD=debug USE_OPENGL=1
mingw32-make -f makefile.gcc USE_XRC=1 MONOLITHIC=1 SHARED=0 UNICODE=1 BUILD=release USE_OPENGL=1
so in theory I have static libraries + dll version. DLL applications compile & link like a charm. If I create new test project and disable "DLL linking" (or something like this), it works. But the main project doesnt link at all.
I changed global compiler settings to:
$linker -o $exe_output $libdirs $link_objects $link_resobjects $libs $link_options -mwindows
my linker settings:
libwxmsw28u_gl.a (I tried almost everything here)
libwxpng.a
libwxjpeg.a
libwxtiff.a
libwxzlib.a
search dirs (compiler, linker, resource):
C:\wxWidgets-2.8.8\lib\gcc_lib\mswu
C:\wxWidgets-2.8.8\lib\gcc_lib
C:\wxWidgets-2.8.8\lib\gcc_lib\mswu
still what I get is:
obj\Release_static\dungeon_editorApp.o:dungeon_editorApp.cpp:(.text+0x49)||undefined reference to `_imp___ZN12wxAppConsole17CheckBuildOptionsEPKcS1_'|
obj\Release_static\dungeon_editorApp.o:dungeon_editorApp.cpp:(.text+0x6c)||undefined reference to `_imp___ZN5wxAppC2Ev'|
obj\Release_static\dungeon_editorApp.o:dungeon_editorApp.cpp:(.text+0xd2)||undefined reference to `_imp___ZN12wxAppConsole14ms_appInstanceE'|
obj\Release_static\dungeon_editorApp.o:dungeon_editorApp.cpp:(.text+0x103)||undefined reference to `_imp___Z7wxEntryP11HINSTANCE__S0_Pci'|
obj\Release_static\dungeon_editorApp.o:dungeon_editorApp.cpp:(.text+0x157)||undefined reference to `_imp___Z22wxInitAllImageHandlersv'|
obj\Release_static\dungeon_editorApp.o:dungeon_editorApp.cpp:(.text+0x202)||undefined reference to `_imp___ZN12wxAppConsole12ms_appInitFnE'|
(and so on....) A LOT!
PLEASE HELP! :shock:
Are you linking to libwxmsw28u.a ?
Turn on Compiler Logging and post the link command.
http://wiki.codeblocks.org/index.php?title=FAQ&Itemid=5#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
Tim S
My guess of libraries to link; I don't use wxWidgets Static Monolithic build
libwxmsw28u_gl.a
libwxmsw28u.a
libwxpng.a
libwxjpeg.a
libwxtiff.a
libwxzlib.a
mingw32-g++.exe -o bin\Release_static\dungeon_editor.exe -LC:\wxWidgets-2.8.8\lib\gcc_lib -LC:\wxWidgets-2.8.8\lib\gcc_lib
-LC:\MinGW\lib obj\Release_static\dungeon_editorApp.o obj\Release_static\dungeon_editorMain.o obj\Release_static\mapTile.o
obj\Release_static\NewSetDialog.o obj\Release_static\resource.res -lwxmsw28u_gl -lwxpng -lwxjpeg -lwxtiff -lwxzlib -lkernel32
-luser32 -lgdi32 -s -mwindows
I checked with -lwxmsw28u as well. still nothing :?
mingw32-g++.exe -O2 -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE
-IC:\wxWidgets-2.8.8\lib\gcc_lib\mswu -IC:\wxWidgets-2.8.8\include
-IC:\wxWidgets-2.8.8\contrib\include -IC:\wxWidgets-2.8.8\lib\gcc_dll\mswu -IC:\glut-3.7.6-bin
-IC:\wxWidgets-2.8.8\lib\gcc_lib\mswu -c "C:\C projects\dungeon_editor\mapTile.cpp"
-o obj\Release_static\mapTile.o
windres.exe -i C:\CPROJE~1\DUNGEO~2\resource.rc -J rc -o obj\Release_static\resource.res -O coff
-IC:\wxWidgets-2.8.8\lib\gcc_lib\mswu -IC:\wxWidgets-2.8.8\include -IC:\MinGW\include
mingw32-g++.exe -O2 -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE
-IC:\wxWidgets-2.8.8\lib\gcc_lib\mswu -IC:\wxWidgets-2.8.8\include -IC:\wxWidgets-2.8.8\contrib\include
-IC:\wxWidgets-2.8.8\lib\gcc_dll\mswu -IC:\glut-3.7.6-bin -IC:\wxWidgets-2.8.8\lib\gcc_lib\mswu
-c "C:\C projects\dungeon_editor\NewSetDialog.cpp" -o obj\Release_static\NewSetDialog.o
mingw32-g++.exe -o bin\Release_static\dungeon_editor.exe -LC:\wxWidgets-2.8.8\lib\gcc_lib -LC:\wxWidgets-2.8.8\lib\gcc_lib
-LC:\MinGW\lib obj\Release_static\dungeon_editorApp.o obj\Release_static\dungeon_editorMain.o obj\Release_static\mapTile.o
obj\Release_static\NewSetDialog.o obj\Release_static\resource.res -lwxmsw28u -lwxmsw28u_gl -lwxpng -lwxjpeg -lwxtiff
-lwxzlib -s -mwindows
ok,so now we have:
mingw32-g++.exe -O2 -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE
-IC:\wxWidgets-2.8.8\lib\gcc_lib\mswu -IC:\wxWidgets-2.8.8\include -IC:\wxWidgets-2.8.8\contrib\include
-IC:\wxWidgets-2.8.8\lib\gcc_lib\mswu -IC:\glut-3.7.6-bin -c "C:\C projects\dungeon_editor\dungeon_editorApp.cpp"
-o obj\Release_static\dungeon_editorApp.o
mingw32-g++.exe -O2 -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE
-IC:\wxWidgets-2.8.8\lib\gcc_lib\mswu -IC:\wxWidgets-2.8.8\include -IC:\wxWidgets-2.8.8\contrib\include
-IC:\wxWidgets-2.8.8\lib\gcc_lib\mswu -IC:\glut-3.7.6-bin -c "C:\C projects\dungeon_editor\dungeon_editorMain.cpp"
-o obj\Release_static\dungeon_editorMain.o
mingw32-g++.exe -O2 -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE
-IC:\wxWidgets-2.8.8\lib\gcc_lib\mswu -IC:\wxWidgets-2.8.8\include -IC:\wxWidgets-2.8.8\contrib\include
-IC:\wxWidgets-2.8.8\lib\gcc_lib\mswu -IC:\glut-3.7.6-bin -c "C:\C projects\dungeon_editor\mapTile.cpp"
-o obj\Release_static\mapTile.o
windres.exe -i C:\CPROJE~1\DUNGEO~2\resource.rc -J rc -o obj\Release_static\resource.res -O coff
-IC:\wxWidgets-2.8.8\lib\gcc_lib\mswu -IC:\wxWidgets-2.8.8\include -IC:\MinGW\include
mingw32-g++.exe -O2 -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE
-IC:\wxWidgets-2.8.8\lib\gcc_lib\mswu -IC:\wxWidgets-2.8.8\include -IC:\wxWidgets-2.8.8\contrib\include
-IC:\wxWidgets-2.8.8\lib\gcc_lib\mswu -IC:\glut-3.7.6-bin -c "C:\C projects\dungeon_editor\NewSetDialog.cpp"
-o obj\Release_static\NewSetDialog.o
mingw32-g++.exe -o bin\Release_static\dungeon_editor.exe -LC:\wxWidgets-2.8.8\lib\gcc_lib
-LC:\wxWidgets-2.8.8\lib\gcc_lib -LC:\MinGW\lib obj\Release_static\dungeon_editorApp.o
obj\Release_static\dungeon_editorMain.o obj\Release_static\mapTile.o obj\Release_static\NewSetDialog.o
obj\Release_static\resource.res -lwxmsw28u_gl -lwxmsw28u -lwxpng -lwxjpeg -lwxtiff -lwxzlib -s -mwindows
I changed order of libraries and I kicked out the DLL search path. By the way: I thought wxms28u and wxms28u_gl are the same- second is with gl enabled - but obviously I was wrong: one is 18mb, second 800 bytes ;)
ONE SECOND!
Now I am getting different set of linking errors - obviously wx errors are gone and now it's standard set of ole etc.
I think you are Programming God, Tim ;)