Helloworld MinGW32 GCC Compiler Errors

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.
New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 361
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: Helloworld MinGW32 GCC Compiler Errors

Post by New Pagodi » Thu Apr 21, 2016 11:33 pm

There's at least 2 problems here. First on your compiler line:
chrismac wrote:-------------- Build: Debug in Helloworld (compiler: GNU GCC Compiler)---------------

g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ E:\wxWidgets-3.1.0\lib\gcc_dll\mswu -IE:\wxWidgets-3.1.0\include -IE:\wxWidgets-3.1.0\lib\gcc_dll\mswud -IE:\wxWidgets-3.1.0 -IE:\Chris\Dev\Cpp\HelloWorld -c E:\Chris\Dev\Cpp\HelloWorld\HelloworldApp.cpp -o obj\Debug\HelloworldApp.o
The bolded part means you have an extra "$(#wx)\lib\gcc_dll\mswu" somewhere - probably in "Other compiler options. For the project options, those should look like:
proj-oco.png
proj-oco.png (3.91 KiB) Viewed 1479 times
And the debug and release targets should both be empty:
target-oco.png
target-oco.png (4 KiB) Viewed 1479 times
If it's not in either of those places, check the global compiler options.

New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 361
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: Helloworld MinGW32 GCC Compiler Errors

Post by New Pagodi » Thu Apr 21, 2016 11:47 pm

For the link line:
chrismac wrote:g++.exe -LE:\wxWidgets-3.1.0\lib\gcc_dll -LE:\wxWidgets-3.1.0\lib\gcc_dll\ -o bin\Debug\Helloworld.exe obj\Debug\HelloworldApp.o -mthreads -lwxmsw31ud E:\wxWidgets-3.1.0\lib\gcc_dll -mwindows
The bolded part means you have "$(#wx)\lib\gcc_dll" listed in linker settings somewhere. For the main project, these should look like:
proj-ls.png
proj-ls.png (5.73 KiB) Viewed 1479 times
For a debug, multilib build, the target settings should look like:
target-ls.png
target-ls.png (5.91 KiB) Viewed 1479 times
For a monolithic build, the listing will be a little different (I think there will be only 1 item listed). But in either case, the only things listed should be link libraries. No folders should be listed in linker settings.

chrismac
Earned a small fee
Earned a small fee
Posts: 12
Joined: Tue Apr 19, 2016 1:57 am

Re: Helloworld MinGW32 GCC Compiler Errors

Post by chrismac » Thu Apr 21, 2016 11:58 pm

As far as I can tell, i no longer have $(#wx)\lib\gcc_dll\mswu\ or $(#wx)\lib\gcc_dll\mswud\ in the Linker search directories, just the Compiler's, so Linking is only searching in -- $(#wx)\lib\gcc_dll\* . I can't see any setting that would cause the Linker to search those compiler subdirectories -- $(#wx)\lib\gcc_dll\mswu\ . Thoughts ?

chrismac
Earned a small fee
Earned a small fee
Posts: 12
Joined: Tue Apr 19, 2016 1:57 am

Re: Helloworld MinGW32 GCC Compiler Errors

Post by chrismac » Fri Apr 22, 2016 12:26 am

Yes you're right on the money, ta so much - quite a bit of a learning curve for this fancy CB IDE, but worth it. I did have $(#wx)\lib\gcc_dll\* in the global linker options. It's been replaced with the needed archives per your suggestion and now linking is working. Just have one last thing to resolve, but will give it some effort before seeking clarification. Ta.

chrismac
Earned a small fee
Earned a small fee
Posts: 12
Joined: Tue Apr 19, 2016 1:57 am

Re: Helloworld MinGW32 GCC Compiler Errors

Post by chrismac » Fri Apr 22, 2016 12:44 am

It works :-), just also needed the environment path variable to include the path to E:\wxWidgets-3.1.0\lib\gcc_dll\ to use the monolithic dll .

This is using, as per your suggestion, the latest wxWidgets 3.1.0 , and MinGW32 that comes standard with Codeblocks IDE, to compile both the wxWidgets libraries, and also using the standard IDE to compile HelloworldApp.cpp . Now to see if a related combination, in a separate wxWidgets folder, will also produce static code, that doesn't rely on distributing a dll -- which apparently is error prone for Windows setups.

Post Reply