Cannot find -lwxmsw30

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
AngryBinary
In need of some credit
In need of some credit
Posts: 7
Joined: Thu Dec 08, 2016 8:50 pm

Cannot find -lwxmsw30

Post by AngryBinary »

Hello,

I have installed MinGW, Code blocks 16.01 and wxWidgets 3.0.2.
When I try to compile test project i get following error.
Build messages:
=== Build: Release in Test (compiler: GNU GCC Compiler) ===
ld.exe cannot find -lwxmsw30|
error: ld returned 1 exit status

=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 9 second(s)) ===
Build log:
-------------- Clean: Release in Test (compiler: GNU GCC Compiler)---------------

Cleaned "Test - Release"

-------------- Build: Release in Test (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall -std=c++11 -pipe -mthreads -Winvalid-pch -include wx_pch.h -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DWX_PRECOMP -O2 -IC:\wxWidgets-3.0.2\include -IC:\wxWidgets-3.0.2\lib\gcc_dll\mswu -IC:\wxWidgets-3.0.2\lib\gcc_dll\msw\wx -c C:\Users\Martynas\Cpp_prj\Test\wx_pch.h -o wx_pch.h.gch\Release_wx_pch_h_gch
windres.exe -IC:\wxWidgets-3.0.2\include -IC:\wxWidgets-3.0.2\lib\gcc_dll\msw -J rc -O coff -i C:\Users\Martynas\Cpp_prj\Test\resource.rc -o obj\Release\resource.res
mingw32-g++.exe -Wall -std=c++11 -pipe -mthreads -Winvalid-pch -include wx_pch.h -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DWX_PRECOMP -O2 -IC:\wxWidgets-3.0.2\include -IC:\wxWidgets-3.0.2\lib\gcc_dll\mswu -IC:\wxWidgets-3.0.2\lib\gcc_dll\msw\wx -c C:\Users\Martynas\Cpp_prj\Test\TestApp.cpp -o obj\Release\TestApp.o
mingw32-g++.exe -Wall -std=c++11 -pipe -mthreads -Winvalid-pch -include wx_pch.h -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DWX_PRECOMP -O2 -IC:\wxWidgets-3.0.2\include -IC:\wxWidgets-3.0.2\lib\gcc_dll\mswu -IC:\wxWidgets-3.0.2\lib\gcc_dll\msw\wx -c C:\Users\Martynas\Cpp_prj\Test\TestMain.cpp -o obj\Release\TestMain.o
mingw32-g++.exe -LC:\wxWidgets-3.0.2\lib\gcc_dll -o bin\Release\Test.exe obj\Release\TestApp.o obj\Release\TestMain.o obj\Release\resource.res -s -mthreads -lwxmsw30 -mwindows
c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw30
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 9 second(s))
2 error(s), 0 warning(s) (0 minute(s), 9 second(s))
Under project build options >linker settings there is link library libwxmsw30.a. I search entire wxwidgets (wxwidgets installed under C:\wxwidgets-3.0.2) folder, but there is no file named libwxmsw30.a.

Help is appreciated.
New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 469
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: Cannot find -lwxmsw30

Post by New Pagodi »

Starting with wxWidgets 3.0, the default build option for the library is to use unicode. So the library you need to like to is libwxmsw30u.a

To do this in codeblocks, on the page of the wizard that says "please select various configuration options", you need to make sure "Enable unicode" is checked.

If that doesn't work, can you post the make command you used to build the wxWidgets libaries.
AngryBinary
In need of some credit
In need of some credit
Posts: 7
Joined: Thu Dec 08, 2016 8:50 pm

Re: Cannot find -lwxmsw30

Post by AngryBinary »

I created new project, checked "Enable unicode" in a process.
Replaced libwxmsw30.a entries with libwxbase30u.a (because I don't have libwxbase30u.a) an project compiled successfully.
My make command:

Code: Select all

mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release CXXFLAGS=-std=gnu+11
had to add CXXFLAGS part, because it refused to build without it
New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 469
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: Cannot find -lwxmsw30

Post by New Pagodi »

AngryBinary wrote:I created new project, checked "Enable unicode" in a process.
Replaced libwxmsw30.a entries with libwxbase30u.a (because I don't have libwxbase30u.a) an project compiled successfully.
My make command:

Code: Select all

mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release CXXFLAGS=-std=gnu+11
had to add CXXFLAGS part, because it refused to build without it
I just downloaded tdm64-gcc-5.1.0-2 and tried to build a set of libraries with that command.

Anyway, I think it on the same page where you checked the box for "enable unicode", if you uncheck the box that says "wxWidgets is built as a monolithic library", codeblocks should set up the libraries correctly so that you don't need to make any changes.
AngryBinary
In need of some credit
In need of some credit
Posts: 7
Joined: Thu Dec 08, 2016 8:50 pm

Re: Cannot find -lwxmsw30

Post by AngryBinary »

I tried as you advised, but it did not work.
I get:

Code: Select all

C:\wxWidgets-3.0.2\include\wx\platform.h|183|fatal error: wx/setup.h: No such file or directory|
Must be something with my setup.
Post Reply