Code::Blocks Forums

User forums => Help => Topic started by: Sh4wn on June 29, 2006, 08:08:24 pm

Title: cannot find -lwxmsw
Post by: Sh4wn on June 29, 2006, 08:08:24 pm
I have a problem using wxWidgets, and linking the library...

I'm using C::B 1.0 rc2, Windows XP pro, MinGW compiler.

I've installed wxWidgets on D:\C++\wx

I've added all .a files to my Link Libraries. Also WX_DIR is set.

This is my full compile log:

Quote
Project   : Lucky Bot
Compiler  : GNU GCC Compiler (called directly)
Directory : D:\C++\Projects\LuckyBot\
--------------------------------------------------------------------------------
Switching to target: default
mingw32-g++.exe   -LD:\C++\wx\lib\gcc_lib -LD:\C++\wx\lib\gcc_lib  -L"D:\Program Files\CodeBlocks\lib" -L"C:\Documents and Settings\Lucas\My Documents\Mijn Downloads\lib" -o D:\C++\Projects\LuckyBot\LuckyBot.exe .objs\main.o .objs\frame.o        -lwxmsw -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -lodbc32 -ladvapi32 -lwsock32 -lopengl32 -lglu32 -lole32 -loleaut32 -luuid D:\C++\wx\lib\gcc_lib\libwxzlib.a D:\C++\wx\lib\gcc_lib\libwxexpat.a D:\C++\wx\lib\gcc_lib\libwxjpeg.a D:\C++\wx\lib\gcc_lib\libwxmsw26.a D:\C++\wx\lib\gcc_lib\libwxmsw26_animate.a D:\C++\wx\lib\gcc_lib\libwxmsw26_deprecated.a D:\C++\wx\lib\gcc_lib\libwxmsw26_fl.a D:\C++\wx\lib\gcc_lib\libwxmsw26_foldbar.a D:\C++\wx\lib\gcc_lib\libwxmsw26_gizmos.a D:\C++\wx\lib\gcc_lib\libwxmsw26_gizmos_xrc.a D:\C++\wx\lib\gcc_lib\libwxmsw26_mmedia.a D:\C++\wx\lib\gcc_lib\libwxmsw26_netutils.a D:\C++\wx\lib\gcc_lib\libwxmsw26_ogl.a D:\C++\wx\lib\gcc_lib\libwxmsw26_plot.a D:\C++\wx\lib\gcc_lib\libwxmsw26_stc.a D:\C++\wx\lib\gcc_lib\libwxmsw26_svg.a D:\C++\wx\lib\gcc_lib\libwxpng.a D:\C++\wx\lib\gcc_lib\libwxregex.a D:\C++\wx\lib\gcc_lib\libwxtiff.a D:\C++\wx\lib\gcc_lib\libwxmsw26.a D:\C++\wx\lib\gcc_lib\libwxexpat.a D:\C++\wx\lib\gcc_lib\libwxjpeg.a D:\C++\wx\lib\gcc_lib\libwxmsw26_animate.a D:\C++\wx\lib\gcc_lib\libwxmsw26_deprecated.a D:\C++\wx\lib\gcc_lib\libwxmsw26_fl.a D:\C++\wx\lib\gcc_lib\libwxmsw26_foldbar.a D:\C++\wx\lib\gcc_lib\libwxmsw26_gizmos.a D:\C++\wx\lib\gcc_lib\libwxmsw26_gizmos_xrc.a D:\C++\wx\lib\gcc_lib\libwxmsw26_mmedia.a D:\C++\wx\lib\gcc_lib\libwxmsw26_netutils.a D:\C++\wx\lib\gcc_lib\libwxmsw26_ogl.a D:\C++\wx\lib\gcc_lib\libwxmsw26_plot.a D:\C++\wx\lib\gcc_lib\libwxmsw26_stc.a D:\C++\wx\lib\gcc_lib\libwxmsw26_svg.a D:\C++\wx\lib\gcc_lib\libwxpng.a D:\C++\wx\lib\gcc_lib\libwxregex.a D:\C++\wx\lib\gcc_lib\libwxtiff.a D:\C++\wx\lib\gcc_lib\libwxzlib.a  -mwindows
D:\Program Files\CodeBlocks\bin\..\lib\gcc\mingw32\3.4.4\..\..\..\..\mingw32\bin\ld.exe: cannot find -lwxmsw
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)

Does anybody know how I can fix this?
Title: Re: cannot find -lwxmsw
Post by: MortenMacFly on June 29, 2006, 09:52:22 pm
Does anybody know how I can fix this?
You have made a very "simply" mistake (once you know you'll never do it again... ;-)):
You shouold not link all the libs that are available to your application. The only thing your project "complains" about: "cannot find -lwxmsw". This you can resolve easily by adding the path to your wxWidgets libs to the linker path's of your project. Then remove all "direct linkings" of libraries -> all that begin with "D:\C++\wx\lib\gcc_lib\lib[...]". The usual way is to add them as e.g. "wxmsw26" and add the path "D:\C++\wx\lib\gcc_lib" to your linker directories. Please notice the "26" which was the only thing missing in yur configuration.
With regards, Morten.
Title: Re: cannot find -lwxmsw
Post by: Sh4wn on June 30, 2006, 12:01:55 pm
Ok thanks! I got it working now. :)

But one question, does it now work on all platforms, without making any changes to the linkers?
Title: Re: cannot find -lwxmsw
Post by: sethjackson on June 30, 2006, 02:38:04 pm
Ok thanks! I got it working now. :)

But one question, does it now work on all platforms, without making any changes to the linkers?

No it won't work on all platforms without changing anything....
Title: Re: cannot find -lwxmsw
Post by: Sh4wn on June 30, 2006, 04:23:39 pm
How can I make it work with e.g. Linux then?