Author Topic: please,tell me how to resolve ""ld.exe cannot find -lwxmsw28u""  (Read 10118 times)

Offline exploder

  • Single posting newcomer
  • *
  • Posts: 3
please,tell me how to resolve ""ld.exe cannot find -lwxmsw28u""
« on: January 30, 2008, 04:50:45 am »
I cannot understand the old resolved solution about "ld.exe cannot find -lwxmsw28u".
Compiled wxWidgets with gcc, generated libs are "libwxmsw28u.a" and "wxmsw28u_gcc_custom.dll",
when using CB compiled wxWidgets project, how to find "-lwxmsw28u".
waiting for the wonderful answer.....

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6546
    • My Best Post
Re: please,tell me how to resolve ""ld.exe cannot find -lwxmsw28u""
« Reply #1 on: January 30, 2008, 04:56:38 am »
Did you compile wxWidgets? The best way is to compile wxWidgets
Did you download wxPack? Second best way for windows Users


Did you set the wx Global variable?
What is the wx Global variable set to?
In my setup, base is set to "F:\SourceCode\Libraries\wxWidgets\wxMSW-2.8.7"
What is the path of the folder that contains the file libwxmsw28u.a.
In my setup it is "F:\SourceCode\Libraries\wxWidgets\wxMSW-2.8.7\lib\gcc_dll"

Note: the wx base should be set to the path to file libwxmsw28u.a without the trailing "\lib\gcc_dll"
The wx path for lib and include should be left blank.

Please turn on full Compiler Logging.
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

And post the "Build Log". (Not just the Build Messages.)

Tim S
« Last Edit: January 30, 2008, 05:25:33 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline exploder

  • Single posting newcomer
  • *
  • Posts: 3
Re: please,tell me how to resolve ""ld.exe cannot find -lwxmsw28u""
« Reply #2 on: January 30, 2008, 07:33:57 am »
To stahta01:
  thank you very much!!! :P

  I had compiler wxWidgets successfully.
  and,  I had set Global variable named "wx", the "base " is set to :D:\bin\wxWidgets\wxWidgets-2.8.7
  "include" and "lib" fields is blank;
   "libwxmsw28u.a" in "D:\bin\wxWidgets\wxWidgets-2.8.7\lib\gcc_dll\".
   using  CB wizard to create project,if I check "use wxWidgets DLL",it can compile sucessful,also can run .
   But,I do not want to use as DLL,want to compile with static lib, so not chek "use wxWidgets DLL";thus,problem happended.
   and, in my project build options,I can see , it has following lib(automaticly added by CB):
     libwxmsw28u.a
     libwxpng.a
     libwxjpeg.a
     libwxtiff.a
     libwxzlib.a
   So , I cofused.
 
 following is Build log:


-------------- Build: Release in Demo2 ---------------

mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE  -Wall  -O2    -ID:\bin\wxWidgets\wxWidgets-2.8.7\include -ID:\bin\wxWidgets\wxWidgets-2.8.7\contrib\include -ID:\bin\wxWidgets\wxWidgets-2.8.7\lib\gcc_lib\mswu -ID:\bin\wxWidgets\wxWidgets-2.8.7\include -ID:\bin\wxWidgets\wxWidgets-2.8.7\lib\gcc_dll\mswu -ID:\bin\wxWidgets\wxWidgets-2.8.7\lib\gcc_dll\mswud  -c E:\mytest\wxWiegets\CodeBlocks\Demo2\Demo2Main.cpp -o obj\Release\Demo2Main.o
windres.exe -i E:\mytest\WXWIEG~1\CODEBL~1\Demo2\resource.rc -J rc -o obj\Release\resource.res -O coff -ID:\bin\wxWidgets\wxWidgets-2.8.7\include -ID:\bin\wxWidgets\wxWidgets-2.8.7\lib\gcc_lib\mswu
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE  -Wall  -O2    -ID:\bin\wxWidgets\wxWidgets-2.8.7\include -ID:\bin\wxWidgets\wxWidgets-2.8.7\contrib\include -ID:\bin\wxWidgets\wxWidgets-2.8.7\lib\gcc_lib\mswu -ID:\bin\wxWidgets\wxWidgets-2.8.7\include -ID:\bin\wxWidgets\wxWidgets-2.8.7\lib\gcc_dll\mswu -ID:\bin\wxWidgets\wxWidgets-2.8.7\lib\gcc_dll\mswud  -c E:\mytest\wxWiegets\CodeBlocks\Demo2\Demo2App.cpp -o obj\Release\Demo2App.o
mingw32-g++.exe -LD:\bin\wxWidgets\wxWidgets-2.8.7\lib\gcc_lib -LD:\bin\wxWidgets\wxWidgets-2.8.7\lib  -o bin\Release\Demo2.exe obj\Release\Demo2Main.o obj\Release\Demo2App.o  obj\Release\resource.res  -s  -lwxmsw28u -lwxpng -lwxjpeg -lwxtiff -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32  -mwindows
D:\bin\wxWidgets\CodeBlocks\bin\..\lib\gcc\mingw32\3.4.4\..\..\..\..\mingw32\bin\ld.exe: cannot find -lwxmsw28u
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 20 seconds)
1 errors, 0 warnings

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6546
    • My Best Post
Re: please,tell me how to resolve ""ld.exe cannot find -lwxmsw28u""
« Reply #3 on: January 30, 2008, 03:27:54 pm »
Do you have the file libwxmsw28u.a in folder D:\bin\wxWidgets\wxWidgets-2.8.7\lib\gcc_lib ?
Are you using debug, if so needs libwxmsw28ud.a in folder also.

Did you compile wxWidgets for Static Build?
If so, what was the build command used?


NOTE: You can only use a single wxWidgets with an project in most cases, your build log says you are trying to use both static and DLL build of wxWidgets. This will fail in nearly all Cases.

Also, I suggest upgrading to MinGW GCC 3.4.5 instead of 3.4.4; there are some minor/major problems that may need worked around if you do not. This is NOT the cause of current problem, but might cause future issues. The Binutils has a bug in it that were normally installed with 3.4.4; the resource compiler windres.exe has a bug or two in it most likely.

Tim S
« Last Edit: January 30, 2008, 03:59:53 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org