User forums > Help

Static linking problem - wxWidgets

(1/2) > >>

siegfried:
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:

--- Code: ---libwxmsw28u_gl.a (I tried almost everything here)
libwxpng.a
libwxjpeg.a
libwxtiff.a
libwxzlib.a

--- End code ---

search dirs (compiler, linker, resource):

--- Code: ---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

--- End code ---

still what I get is:

--- Code: ---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!

--- End code ---

PLEASE HELP!  :shock:


stahta01:
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

--- Code: ---libwxmsw28u_gl.a
libwxmsw28u.a
libwxpng.a
libwxjpeg.a
libwxtiff.a
libwxzlib.a

--- End code ---

siegfried:

--- Code: ---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

--- End code ---
I checked with -lwxmsw28u as well. still nothing  :?

stahta01:
Try it again with lib wxmsw28u again and post both the compiler and link commands.
And, the error messages

Tim S

siegfried:

--- Code: ---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


--- End code ---


Navigation

[0] Message Index

[#] Next page

Go to full version