Author Topic: WxWidgets Project in Code::Blocks - ld.exe cannot find -lwxmsw30d  (Read 9736 times)

Offline DarthVega7

  • Single posting newcomer
  • *
  • Posts: 6
Hello,

I'm getting the error:  ld.exe cannot find -lwxmsw30d when I try to build and run a wxwidgets project in code::blocks.

Please help?

Thanks,

- DV

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
« Last Edit: February 20, 2015, 07:22:40 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline DarthVega7

  • Single posting newcomer
  • *
  • Posts: 6
Re: WxWidgets Project in Code::Blocks - ld.exe cannot find -lwxmsw30d
« Reply #2 on: February 20, 2015, 07:30:16 pm »
Code
-------------- Build: Debug in wxTest (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -LC:\SourceCode\Libraries\wxWidgets3.0\lib\gcc_dll -o bin\Debug\wxTest.exe  obj\Debug\wxTestApp.o obj\Debug\wxTestMain.o obj\Debug\resource.res -mthreads  -lwxmsw30d -mwindows
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw30d
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: WxWidgets Project in Code::Blocks - ld.exe cannot find -lwxmsw30d
« Reply #3 on: February 20, 2015, 08:46:00 pm »
Does the library exist inside your folder C:\SourceCode\Libraries\wxWidgets3.0\lib\gcc_dll ?
If not, then you need to change the project options or you need to build the missing library.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline DarthVega7

  • Single posting newcomer
  • *
  • Posts: 6
Re: WxWidgets Project in Code::Blocks - ld.exe cannot find -lwxmsw30d
« Reply #4 on: February 20, 2015, 09:15:14 pm »
I'm sorry, I'm such a newb... How do I build the missing library?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: WxWidgets Project in Code::Blocks - ld.exe cannot find -lwxmsw30d
« Reply #5 on: February 20, 2015, 09:29:37 pm »
http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef#Build_wxWidgets

Does wxmsw30ud library exist?
You do know that unicode is required with wxWidgets 3.0 unless you are a expert.

IIRC, "BUILD=debug" is needed for wxWidgets debug version.

Tim S.
« Last Edit: February 20, 2015, 09:44:36 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline DarthVega7

  • Single posting newcomer
  • *
  • Posts: 6
Re: WxWidgets Project in Code::Blocks - ld.exe cannot find -lwxmsw30d
« Reply #6 on: February 20, 2015, 10:48:25 pm »
Whenever I try to build the library it gives me this:

Code
C:\SourceCode\Libraries\wxWidgets3.0\build\msw>C:\MinGW\bin\mingw32-make.exe -f
makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 CXXFLAGS=-fno-keep-in
line-dllexport
gcc -c -o gcc_mswudll\wxregex_regcomp.o  -O2 -mthreads  -DHAVE_W32API_H -DNDEBUG
 -I..\..\include -I..\..\lib\gcc_dll\mswu -D__WXMSW__  -D_UNICODE   -MTgcc_mswud
ll\wxregex_regcomp.o -MFgcc_mswudll\wxregex_regcomp.o.d -MD -MP ../../src/regex/
regcomp.c
gcc: error: CreateProcess: No such file or directory
makefile.gcc:5698: recipe for target 'gcc_mswudll\wxregex_regcomp.o' failed
mingw32-make: *** [gcc_mswudll\wxregex_regcomp.o] Error 1

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: WxWidgets Project in Code::Blocks - ld.exe cannot find -lwxmsw30d
« Reply #7 on: February 21, 2015, 01:21:44 am »
Whenever I try to build the library it gives me this:

Code
C:\SourceCode\Libraries\wxWidgets3.0\build\msw>C:\MinGW\bin\mingw32-make.exe -f
makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 CXXFLAGS=-fno-keep-in
line-dllexport
gcc -c -o gcc_mswudll\wxregex_regcomp.o  -O2 -mthreads  -DHAVE_W32API_H -DNDEBUG
 -I..\..\include -I..\..\lib\gcc_dll\mswu -D__WXMSW__  -D_UNICODE   -MTgcc_mswud
ll\wxregex_regcomp.o -MFgcc_mswudll\wxregex_regcomp.o.d -MD -MP ../../src/regex/
regcomp.c
gcc: error: CreateProcess: No such file or directory
makefile.gcc:5698: recipe for target 'gcc_mswudll\wxregex_regcomp.o' failed
mingw32-make: *** [gcc_mswudll\wxregex_regcomp.o] Error 1

I suggest reading this site in case you can find the cause on it; also your problem would be more on target on that site.
https://forums.wxwidgets.org/index.php

I have gotten that error before; but, I am not sure why.

I did find that this fixes some weired errors.

Instead of
Code
mingw32-make.exe -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 CXXFLAGS=-fno-keep-in
line-dllexport
I add SHELL=CMD.exe so it becomes
Code
mingw32-make.exe -f makefile.gcc SHELL=CMD.exe BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 CXXFLAGS=-fno-keep-in
line-dllexport

Note I do NOT have to do that myself because I build wxWidgets by setting the PATH system variable to a valid value before doing the make command.

Edit: Valid value means one that only contains the MinGW GCC and the 2 to 4 required Windows folders.

Edit2: You might wish to try this and see if the error goes away.

Code
SET PATH=C:\MinGW\bin;%PATH%
mingw32-make.exe -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 CXXFLAGS=-fno-keep-inline-dllexport

Tim S.


« Last Edit: February 21, 2015, 02:50:39 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org