Author Topic: [solved] codeblocks 13.12 & wxWidgets 3.0 config, ld.exe cannot find -lwxmsw30u?  (Read 62176 times)

Offline imduke

  • Single posting newcomer
  • *
  • Posts: 4
Hi there, I'm a totally newbie on codeblocks, I've struggled 4 days with cb & wxWidgets configurations with corrected some errors which found in the internet, but now I really need a help !

I've installed cb with TDM-GCC a few days with no problem, working pretty good. Also I wanna add wxWidgets library, now the configuration progress, I followed the wxWidgets' wiki official guide: http://wiki.codeblocks.org/index.php?title=Using_wxWidgets

And I created a test project, it's the cb auto generated one, and running build, but finally I got one build error: 'ld.exe cannot find -lwxmsw30u'

My compilation & configuration progress was:

downloaded files:
1). TDM-GCC-webdl.exe (select 32bit not 32/64)
2). wxWidgets-3.0.0.zip
3). codeblocks-13.12-setup.exe

add  environment variables as C:\TDM-GCC-32\bin
mingw32-make -f makefile.gcc clean
mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 MONOLITHIC=1 BUILD=debug

add environment variables as:
WXCFG = C:\wxWidgets-3.0.0
WXWIN = gcc_dll\mswud (I have no mswu directory)
add menu -> Global compiler settings -> Search directory by C:\wxWidgets-3.0.0\lib\gcc_dll\mswud

By reading the wiki guide, it says if get error like 'cann't find -lwxmsw28u' then 'You have an incorrect link library in your build options', so I've changed the line to 'WXWIN = gcc_dll\mswud', because 'mingw32-make' as a debug version, there's no mswu directory under gcc_dll, but still the same error.

It seems the cb forum has some similar 'cannot find...' questions, but after read them all, I still can't fix mine! wow, I don't know what should going to do?

Really hope that codeblocks will be designed to internally add the configurations automaticly in a short future!


Awaiting helps, thanks!

« Last Edit: March 01, 2014, 10:06:59 am by imduke »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9693
mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 MONOLITHIC=1 BUILD=debug
If you compile the DEBUG version of wxWidgets,...

By reading the wiki guide, it says if get error like 'cann't find -lwxmsw28u'
You should link against the debug version of the lib named wxmsw28ud.

Please note that wxWidgets also ship with pre-compiled versions of this library for your compiler. If unsure, use these.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline imduke

  • Single posting newcomer
  • *
  • Posts: 4
By reading the wiki guide, it says if get error like 'cann't find -lwxmsw28u'
You should link against the debug version of the lib named wxmsw28ud.

Thank you for the reply, but could you please explain it more detail to me, I'm really don't know how to configure it in progress.

thanks

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7678
    • My Best Post
You NEED to decide what directions you are going to follow; then, you need to follow them.
You should NOT mix two different ways of using wxWidgets with CB and expect them to work!

Either follow the standard windows way of using the Global Variable WX or WX30 or do the wx-config.exe way.

wx-config way includes this step in the codeblocks setup.
Code
add environment variables as:
WXCFG = C:\wxWidgets-3.0.0
WXWIN = gcc_dll\mswud

YOU MUST DECIDE.

You must tell us which way you are doing!

You need to tell us if you are using the CB wxWidgets wizard!
(If the error happens during the wizard you need to tell us.)

You need to post the full re-build log if you want help doing either way. (once finished with running wizard.)
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Tim S.
« Last Edit: February 28, 2014, 03:43:45 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 imduke

  • Single posting newcomer
  • *
  • Posts: 4
Hi:

I never touched the wx-config stuffs neither I didn't know that yet, but you let me know that name now ;-)  I was just followed the wxWidgets' guide, add the Global variable purely, and start my new prject through CB's vizard, thus I think I'm in the standard windows way. Tell me if I'm wrong!

By the way, what differences are their between them?

And hope that you staffs can make a wxWidgets setup guide with step by step screenshot pictures either in Linux, Mac and windows, this will really help newbies or noobs like me to save much times, even can help you to prevent repeat answering much similar noob questions ;-)

Anyway, In my case, first of all, I just created the test project by click the wxWidget icon in the wizard, and follow the steps:
- wxWidgets version -> wxWidgets 3.0.x
- Preferred GUI Builder -> None; Application Type -> Frame Base
  (What differs between Dialog Based and Frame Based? Sorry 4 this, I'm a noob)
- wxWidgetsl location -> $(#wx) <-- which causes an error, so i gave it the exact path
  C:\wxWidgets-3.0.0
- Create "Debug" configuration
- wxWidgets Library Setting -> checked all 3 choices on
  Miscellaneous Settings -> enabled Advanced Options, and it gave me an Warning popup
  says: 'A matching Debug configuration cannot be found in the wxWidgets directory you specified...'

After done these, run build, then it says no wx/setup.h, then after googling found a tips which told me to add next line in 'Settings -> Global compiler settings -> Search directories -> Compiler'
C:\wxWidgets-3.0.0\lib\gcc_dll\mswu
and as mine doesn't have 'mswu' directory, so I changed to 'mswud', then run build, this time it says the above error: 'ld.exe cannot find -lwxmsw30u'

For to catch my mistakes, I've done the same job in virtualbox run win xp with putting the gcc stuffs in directory 'c:\etc\...'

Now is the log:
Code

-------------- Build: Debug in aaa (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Wall -g -IC:\etc\wxWidgets-3.0.0\include -IC:\etc\wxWidgets-3.0.0\lib\gcc_dll\mswu -IC:\etc\wxWidgets-3.0.0\lib\gcc_dll\mswud -c C:\local\codeblocks\aaa\aaaApp.cpp -o obj\Debug\aaaApp.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Wall -g -IC:\etc\wxWidgets-3.0.0\include -IC:\etc\wxWidgets-3.0.0\lib\gcc_dll\mswu -IC:\etc\wxWidgets-3.0.0\lib\gcc_dll\mswud -c C:\local\codeblocks\aaa\aaaMain.cpp -o obj\Debug\aaaMain.o
windres.exe -IC:\etc\wxWidgets-3.0.0\include -IC:\etc\wxWidgets-3.0.0\lib\gcc_dll\mswu -J rc -O coff -i C:\local\CODEBL~1\aaa\resource.rc -o obj\Debug\resource.res
mingw32-g++.exe -LC:\etc\wxWidgets-3.0.0\lib\gcc_dll -o bin\Debug\aaa.exe obj\Debug\aaaApp.o obj\Debug\aaaMain.o  obj\Debug\resource.res -mthreads  -lwxmsw30u -mwindows
c:/etc/tdm-gcc-32/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw30u
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 10 second(s))
1 error(s), 0 warning(s) (0 minute(s), 10 second(s))

Hope that I put enough infos to help myself!

Thank you stahta01 for reply, you are a good man!

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7678
    • My Best Post
You have both
Code
-IC:\etc\wxWidgets-3.0.0\lib\gcc_dll\mswu 
-IC:\etc\wxWidgets-3.0.0\lib\gcc_dll\mswud

Get rid of the one that does NOT exist.

You say you only built debug; is there a logical reason you are doing that instead of both?

Edit: You need to define "__WXDEBUG__" when using the wxWidgets debug library.

Tim S.

« Last Edit: February 28, 2014, 03:50:31 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 stahta01

  • Lives here!
  • ****
  • Posts: 7678
    • My Best Post
My build log on doing wxWidgets 3.0 Debug build Multilib (removed PCH precompile)
(Multilib is the opposite choose of Monolithic build)

Where mine says "gcc48_dll" yours should say "gcc_dll"

Where mine says "-lwxmsw30ud_core -lwxbase30ud" yours should say "-lwxmsw30ud".

Where mine says "testwx48" yours should say "aaa".

My wxWidgets base folder: "C:\wxMSW-3.0\wxWidgets-3.0.0"

Note: You build need not have "-include wx_pch.h" in it.

Note: This option is NOT needed "-Wmissing-include-dirs"

Note: Yours might not have "--use-temp-file" in it; I added that to test something long ago.

Change "wxmsw30u" to "wxmsw30ud" in "Linker Settings" under "Link Libraries"

Note: These NOT needed "-Wfatal-errors -Wno-unused-local-typedefs -Wno-attributes"

Tim S.

Code
windres.exe --use-temp-file -IC:\wxMSW-3.0\wxWidgets-3.0.0\include -IC:\wxMSW-3.0\wxWidgets-3.0.0\lib\gcc48_dll\mswud -J rc -O coff -i E:\OPENSO~1\testwx48\resource.rc -o obj\Debug\resource.res
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -Wall -g -D__WXDEBUG__ -Wmissing-include-dirs -Wfatal-errors -Wno-unused-local-typedefs -Wno-attributes -IC:\wxMSW-3.0\wxWidgets-3.0.0\include -IC:\wxMSW-3.0\wxWidgets-3.0.0\lib\gcc48_dll\mswud -c E:\OpenSourceCode\testwx48\testwx48App.cpp -o obj\Debug\testwx48App.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -Wall -g -D__WXDEBUG__ -Wmissing-include-dirs -Wfatal-errors -Wno-unused-local-typedefs -Wno-attributes -IC:\wxMSW-3.0\wxWidgets-3.0.0\include -IC:\wxMSW-3.0\wxWidgets-3.0.0\lib\gcc48_dll\mswud -c E:\OpenSourceCode\testwx48\testwx48Main.cpp -o obj\Debug\testwx48Main.o
mingw32-g++.exe -LC:\wxMSW-3.0\wxWidgets-3.0.0\lib\gcc48_dll -o bin\Debug\testwx48.exe  obj\Debug\testwx48App.o obj\Debug\testwx48Main.o obj\Debug\resource.res -mthreads  -lwxmsw30ud_core -lwxbase30ud -lwxpngd -lwxzlibd -mwindows
Output file is bin\Debug\testwx48.exe with size 1.75 MB
« Last Edit: February 28, 2014, 03:50:11 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 imduke

  • Single posting newcomer
  • *
  • Posts: 4
thanks, stahta01, it worked!
your answer helped me!

ps: other newbies who meet same trouble like me plz check the attachment file, by check on the red colored area, it will be remove the error!

Offline v-italiano

  • Single posting newcomer
  • *
  • Posts: 3
Hi,
i've same problem but I don't think that problem is only the __WXDEBUG__ option (checked or unchecked);
if i check this advanced option simply the problem becomes "... ld.exe cannot find -lwxmsw30ud" but in my environment
issue remains.

My build log is:
Code
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ -IC:\SourceCode\Libraries\wxWidgets3.0\include -IC:\SourceCode\Libraries\wxWidgets3.0\lib\gcc_dll\mswud -c C:\Users\W7onSSD\Documents\C_PROJECTS\monitor\monitorApp.cpp -o obj\Debug\monitorApp.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ -IC:\SourceCode\Libraries\wxWidgets3.0\include -IC:\SourceCode\Libraries\wxWidgets3.0\lib\gcc_dll\mswud -c C:\Users\W7onSSD\Documents\C_PROJECTS\monitor\monitorMain.cpp -o obj\Debug\monitorMain.o
windres.exe -IC:\SourceCode\Libraries\wxWidgets3.0\include -IC:\SourceCode\Libraries\wxWidgets3.0\lib\gcc_dll\mswud -J rc -O coff -i C:\Users\W7onSSD\Documents\C_PROJECTS\monitor\resource.rc -o obj\Debug\resource.res
mingw32-g++.exe -LC:\SourceCode\Libraries\wxWidgets3.0\lib\gcc_dll -o bin\Debug\monitor.exe obj\Debug\monitorApp.o obj\Debug\monitorMain.o  obj\Debug\resource.res -mthreads  -lwxmsw30ud -mwindows
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw30ud
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 4 second(s))
1 error(s), 0 warning(s) (0 minute(s), 4 second(s))

Problem (for me) is that wizard search in wxWidgets3.0\lib\gcc_dll\mswu or wxWidgets3.0\lib\gcc_dll\mswu when it doesn't exist. I solved changing $(#wx)\lib\gcc_dll\mswud to $(#wx)\lib\gcc48_dll\mswud in searching directory for compiler and resource compiler tabs and changing $(#wx)\lib\gcc_dll to $(#wx)\lib\gcc48_dll in linker tab.

What do you think ?

-Vit

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7678
    • My Best Post
That is one of the correct solution when linking against one of wxPack binary Libraries.

Building against wxWidgets 3.0 binary Libraries has a similar solution.

Tim S.

Hi,
i've same problem but I don't think that problem is only the __WXDEBUG__ option (checked or unchecked);
if i check this advanced option simply the problem becomes "... ld.exe cannot find -lwxmsw30ud" but in my environment
issue remains.

My build log is:
Code
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ -IC:\SourceCode\Libraries\wxWidgets3.0\include -IC:\SourceCode\Libraries\wxWidgets3.0\lib\gcc_dll\mswud -c C:\Users\W7onSSD\Documents\C_PROJECTS\monitor\monitorApp.cpp -o obj\Debug\monitorApp.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ -IC:\SourceCode\Libraries\wxWidgets3.0\include -IC:\SourceCode\Libraries\wxWidgets3.0\lib\gcc_dll\mswud -c C:\Users\W7onSSD\Documents\C_PROJECTS\monitor\monitorMain.cpp -o obj\Debug\monitorMain.o
windres.exe -IC:\SourceCode\Libraries\wxWidgets3.0\include -IC:\SourceCode\Libraries\wxWidgets3.0\lib\gcc_dll\mswud -J rc -O coff -i C:\Users\W7onSSD\Documents\C_PROJECTS\monitor\resource.rc -o obj\Debug\resource.res
mingw32-g++.exe -LC:\SourceCode\Libraries\wxWidgets3.0\lib\gcc_dll -o bin\Debug\monitor.exe obj\Debug\monitorApp.o obj\Debug\monitorMain.o  obj\Debug\resource.res -mthreads  -lwxmsw30ud -mwindows
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw30ud
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 4 second(s))
1 error(s), 0 warning(s) (0 minute(s), 4 second(s))

Problem (for me) is that wizard search in wxWidgets3.0\lib\gcc_dll\mswu or wxWidgets3.0\lib\gcc_dll\mswu when it doesn't exist. I solved changing $(#wx)\lib\gcc_dll\mswud to $(#wx)\lib\gcc48_dll\mswud in searching directory for compiler and resource compiler tabs and changing $(#wx)\lib\gcc_dll to $(#wx)\lib\gcc48_dll in linker tab.

What do you think ?

-Vit
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 v-italiano

  • Single posting newcomer
  • *
  • Posts: 3
Hi



...I just created the test project by click the wxWidget icon in the wizard, and follow the steps:
- wxWidgets version -> wxWidgets 3.0.x
- Preferred GUI Builder -> None; Application Type -> Frame Base
  (What differs between Dialog Based and Frame Based? Sorry 4 this, I'm a noob)

...

Differs are showed in attached png


bye

-Vit

Offline Aaron

  • Multiple posting newcomer
  • *
  • Posts: 59
I am also dealing with a "ld.exe                               cannot find -lwxmsw30u"

In a larger tutorial project.

Build log:

mingw32-g++.exe -L(invalid)\lib\gcc_lib -o bin\Release\wxlConsole.exe obj\Release\portsEnum.o obj\Release\rs232.o obj\Release\wxlConsoleApp.o obj\Release\wxlConsoleMain.o  obj\Release\resource.res -s -mthreads  -lwxmsw30u -lwxpng
-lwxjpeg -lwxtiff -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid
-lcomctl32 -lwsock32 -lodbc32 -mwindows
C:\Program Files\CodeBlocks\MinGW\bin\ld.exe: cannot find -lwxmsw30u
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 2 second(s))
1 error(s), 0 warning(s) (0 minute(s), 2 second(s))

Can this be corrected in an existing project?

Offline v-italiano

  • Single posting newcomer
  • *
  • Posts: 3
For me general solution is:

1) to select in Workspace > "your project name" > Build Options > Search Directories
2) here to change in all three file pathes (Compiler, Linker, Resource Compiler)
each  "...\gcc_dll\.."    with     "...\gcc48_dll\.."
3) to recompile

>Vit

Offline Aaron

  • Multiple posting newcomer
  • *
  • Posts: 59
Quote
1) to select in Workspace > "your project name" > Build Options > Search Directories
2) here to change in all three file pathes (Compiler, Linker, Resource Compiler)
each  "...\gcc_dll\.."    with     "...\gcc48_dll\.."
3) to recompile

Same result.  :-\

C:\Program Files\CodeBlocks\MinGW\bin\ld.exe: cannot find -lwxmsw30u

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
mingw32-g++.exe -L(invalid)\lib\gcc_lib -o bin\Release\wxlConsole.exe obj\Release\portsEnum.o obj\Release\rs232.o obj\Release\wxlConsoleApp.o obj\Release\wxlConsoleMain.o  obj\Release\resource.res -s -mthreads  ......

So you've failed to set you wx global variable and thus the path is invalid.
Settings -> Global variables -> wx -> set proper paths
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Aaron

  • Multiple posting newcomer
  • *
  • Posts: 59
Quote
So you've failed to set you wx global variable and thus the path is invalid.
Settings -> Global variables -> wx -> set proper paths

Failed to set them correctly anyway. 
What additions or changes would you recommended from here.


I could not find folders for the empty fields obj, bin, cflags, and iflags.

Everything was working yesterday until I began chasing errors in one project, now I the error:
ld.exe||cannot find -lwxmsw30d_core|
« Last Edit: March 07, 2015, 05:26:36 am by Aaron2 »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Normally, you don't need to set anything but the base-path.

Offline Aaron

  • Multiple posting newcomer
  • *
  • Posts: 59
I just finished removing all traces of wxWidgets from my problem pc, then compiled a fresh copy.

A simple new project test still produces:
ld.exe        cannot find -lwxmsw30d_core

I have his dialog at the end of the new project wizard also.
« Last Edit: March 07, 2015, 05:57:28 am by Aaron2 »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9693
Well of course you not only need the sources of wxWidgets but also the compiled libs... Compiled preferably with the target compiler of your project. Consult the wx docs how to do so.you'll also find some hints in the x::B wiki.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Aaron

  • Multiple posting newcomer
  • *
  • Posts: 59
UPDATE

I determined that the file libwxmsw30u.a was missing from the C:\wxWidgets-3.0.2\lib\gcc_dll directory, so I copied and pasted it from another pc with wxWidgets & CodeBlocks which operates and builds as properly.

Now, this is the latest build log:
Code
-------------- Build: Debug in 6Martest (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -LC:\wxWidgets-3.0.2\lib\gcc_dll -LC:\wxWidgets-3.0.2\lib\gcc_dll -o bin\Debug\6Martest.exe obj\Debug\_MartestApp.o obj\Debug\_MartestMain.o  obj\Debug\resource.res -mthreads  -lwxmsw30u -mwindows
Warning: .drectve `-aligncomm:"___hexdig_D2A",5' unrecognized
/mingw/lib/libmingw32.a(setargv.o):(.text+0x30): undefined reference to `___chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0x673): undefined reference to `___chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0x7e0): undefined reference to `___chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0x81d): undefined reference to `___chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0x934): undefined reference to `___chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0xb78): more undefined references to `___chkstk_ms' follow
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 9 second(s))
6 error(s), 1 warning(s) (0 minute(s), 9 second(s))

Then I realized I had an old MinGW installed im my C:\ directory, renamed it 'zz_MinGW', and the build is successful.
« Last Edit: March 07, 2015, 06:06:47 pm by Aaron2 »

Raf20076

  • Guest
UPDATE

I determined that the file libwxmsw30u.a was missing from the C:\wxWidgets-3.0.2\lib\gcc_dll directory, so I copied and pasted it from another pc with wxWidgets & CodeBlocks which operates and builds as properly.

>:( Are you kidding me?


Sollution for cannot find -lwxmsw30ud (or lwxmsw31ud, lwxmsw32ud, lwxmsw33ud for the future)

OK! I assume that your wxWidgets 3.1.0 project is opened now in codeblocks
and before you compiled wxWidgets 3.1.0 on your computer

In menu click ->  Project -> Build options....
In Project build options window select
-> Debug (Select compiler -> GNU GCC Compiler)
In Linker settings -> (in Policy select -> Prepend target options to project options)
In Link Librarias select lwxmsw30ud and click Edit button, then change name for lwxmsw31ud click OK then again
In Link Librarias click button Add and type libshlwapi.a click OK then again
In Link Librarias click button Add and type libversion.a click OK then again

In Other link options paste

-lshlwapi
-lversion

In Project build options window select
-> Release (Select compiler -> GNU GCC Compiler)
Select Linker settings and in Link Librarias select lwxmsw30u and click Edit button, then change name for lwxmsw31u click OK

then click OK closing window

In Menu click -> Settings -> Global variables
In Global variable editor window select
In base select folder where your wxWidget is installed usually C:\wxWidgets
In include select folder inlude in your wxWidget folder, usually C:\wxWidgets\include
In lib select folder lib in your wxWidget folder usually C:\wxWidgets\lib

and that's it ;D you don't have to dig a hole using a spoon. I hope i helped





« Last Edit: October 31, 2016, 07:12:45 am by Raf20076 »

Offline alfredfvj

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

I am just starting to learn using Code::Blocks with wxWidgets 3.2.

My original error upon building was ld.exe cannot find -lwxmsw32u. I followed all your instructions and it seemed to work in solving that original error.  However, I am now getting the error:

ld.exe cannot find -llwxmsw32ud (it added an extra "l" as a prefix.

I am really just starting with codeblocks and wxWidgets so please excuse me if this error is just due to my ignorance. I tried searching Google for answers but I wasn't able to find any solution. Any help will be appreciated.


Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1634
The leading 'l' must be removed, just write libwxmsw32ud.a (or libwxmsw32u.a if you do not intend to debug wxWidgets itself).
Remember to put the path to the library in Search directories -> Linker

Offline alfredfvj

  • Single posting newcomer
  • *
  • Posts: 7
Hi Miguel, Thanks for your reply. 

How will I remove the extra "l" from ld.exe?

Please note that my Link libraries list does not have that extra "l". The entries there are as follows:

lwxmsm32ud
libshlwapi.a
libversion.a

I tried searching my project for "llwxmsm32ud" so that I can remove the extra "l" but it was not found.

This is the error message:

||=== Build: Debug in ClicsCP (compiler: tdm64Compile) ===|
ld.exe||cannot find -llwxmsw32ud|
||error: ld returned 1 exit status|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|





Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1634
Quote
Please note that my Link libraries list does not have that extra "l". The entries there are as follows
Code
lwxmsm32ud
libshlwapi.a
libversion.a

Really? I see an extra 'l' as the very first character of your quote.

OTOH, are you sure you want to link with the debug version of wxWidgets?

EDIT: If this is a copy/paste of your setup, please note the "msm" instead of "msw"

Offline alfredfvj

  • Single posting newcomer
  • *
  • Posts: 7
I apologize for the typographical error.

My link library looks like this:

lwxmsw32ud
libshlwapi.a
libversion.a

The first line has only one "l" at the start.

My project is a wxWidget 3.1x with wxSmith as GUI builder and Frame based as Appllication Type.

I did not alter any codes generated by the wizard. I just clicked Build and Run button and I got the error : ld.exe||cannot find -llwxmsw32ud|

I did an experiment and included the extra "l" in my Link Library and made it consistent with what the Builder is looking for.  The first line now read like this:

llwxmsw32ud

The build error now reads like this:

||=== Build: Debug in ClicsCP (compiler: tdm64Compile) ===|
ld.exe||cannot find -lllwxmsw32ud|
||error: ld returned 1 exit status|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

Now there are three l's ("lll") at the beginning.

As to whether I really want to use the Debug version of wxWidgets, the honest answer is I don't really know. I have a very novice understanding of wxWidgets (and Code::Blocks) to make a reliable judgement on that having been exposed to it for just a few days. At this stage, I am just evaluating wxWidgets and wxSmith of Code::Blocks for use in converting a very large legacy application written in MS VFP. From the little that I've seen from Google search, the controls of wxWidgets seem to resemble closely those of VFP. And wxSmith is close enough with the GUI IDE of VFP.

The application that I will be converting has a lot of complex nested iterations and from what I gathered from articles about wxWidgets, the Debug mode will be a useful tool in this type of application. This conclusion of course, is coming from a very little informed perspective and if I will just be exposing myself to undue difficulties, I can do away with the Debug mode. Can I have your opinion on this as well?

Again, thank you very much for your patience. Your reply will be greatly appreciated.







Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1634
Remove the leading 'l' and replace the wxWidgets's debug library with the production one. Write exactly this:
Code
libwxmsw32u.a
libshlwapi.a
libversion.a

You do not need the debug version unless you intend to debug wxWidgets itself.

Offline alfredfvj

  • Single posting newcomer
  • *
  • Posts: 7
As you suggested, I created a new project without the Debug option. My Build Options now only has Release.

Under the Link Library I entered libwxmsw32u and got the error message:

ld.exe  cannot find -lwxmsw32u

Next I tried libwxmsw32u.a and got the same error.

Then I tried including libshlwapi.a and libversion.a and still got the same error.

Is it possible that this is because I'm creating a wxWingets 3.1 project while my wxWidgets is version 3.2?  The code:blocks wizard does not include the option to choose version 3.2.  Does code::blocks nightly build version have this option?  Or maybe I can just install a 3.1 version of WxWidgets.

I will try exploring these options tomorrow (it's getting late in this part of the world and I still have some work to finish). 

Thank you very much for your help.


Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1634
Remember to put the path to the library in Search directories -> Linker

Offline TeMaToS

  • Single posting newcomer
  • *
  • Posts: 1
I had similar issue and spent a loooot of time to fix it and the answer was not found I was able to figure that out by myself.
The issue was related to usage of MinGW inside CodeBlocks folder when compiling project and for compiling wxWidgets I was used MinGW that was installed separately.
Hope that at least it will help someone with similar issue.

Also it is possible that newer/older version of MinGW is incompatible.
« Last Edit: February 09, 2024, 06:42:25 pm by TeMaToS »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7678
    • My Best Post
I had similar issue and spent a loooot of time to fix it and the answer was not found I was able to figure that out by myself.
The issue was related to usage of MinGW inside CodeBlocks folder when compiling project and for compiling wxWidgets I was used MinGW that was installed separately.
Hope that at least it will help someone with similar issue.

Also it is possible that newer/older version of MinGW is incompatible.

Mixing different C++ Compilers in C++ projects tend to fail most of the time; wxWidget is an C++ library.
For reason, research C++ name mangling and C++ ABI Application Binary Interface.

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