Building wxWidgets 3.0.2 errors Topic is solved

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
ChopStick
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed Mar 29, 2017 6:36 am

Building wxWidgets 3.0.2 errors

Post by ChopStick »

Hello,
I'm trying to install wxWidgets for Code Blocks(Windows). I'm using mingw w64 version 6.3.0. I have already removed and added the compiler and tried different setup combinations. Google is not helping me at all, because all the explanations on how to install wxWidgets are more or less the same.

The system variables are at C:\mingw64\mingw64\bin and I don't think I have got MSYS, at least I couldn't find it in the systemvariables.

I'm following this: https://wiki.wxwidgets.org/Compiling_wx ... with_MinGW
At the cleaning the data prompt I get "if exist"

and when I compile the library I get this:

Code: Select all

mingw32-make: *** [gcc_mswudll\wxregex_regcomp.o] Error 1
compilation terminated.
makefile.gcc:5708: recipe for target 'gcc_mswudll\wxregex_regerror.o' failed
mingw32-make: *** [gcc_mswudll\wxregex_regerror.o] Error 1
I hope you can help me,
Thanks

ChopStick
catalin
Moderator
Moderator
Posts: 1618
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: Building wxWidgets 3.0.2 errors

Post by catalin »

Try the instructions in docs/msw/install.txt
Search for * Using plain makefiles:
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: Building wxWidgets 3.0.2 errors

Post by PB »

As always, I will recommend the following steps:
1. Use supported compiler.
2. Make sure that there is only one GCC-based toolchain in the %PATH% or at least that the one you want to use is the first.
3. Make sure there are no remains from previous builds, I would just delete all folders starting with "gcc_" both in WXWIN\build\msw and WXWIN\lib.
4. Follow the official build instructions found in WXWIN\docs\msw\install.txt

When you cannot get the build process to finish successfully with the steps above, post the exact command line you attempted to build wxWidgets with.
ChopStick
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed Mar 29, 2017 6:36 am

Re: Building wxWidgets 3.0.2 errors

Post by ChopStick »

Ok, so first at all, I deleted the whole wxWidget folder and unpacked it again. Than I cleaned it(just to make sure).

Code: Select all

C:\wxWidgets-3.0.2\build\msw>mingw32-make -f makefile.gcc BUILD=release clean -j4
With the return of:

Code: Select all

if exist gcc_mswu\memcheck.exe del gcc_mswu\memcheck.exe
mingw32-make[2]: Leaving directory 'C:/wxWidgets-3.0.2/samples/memcheck'
mingw32-make[1]: Leaving directory 'C:/wxWidgets-3.0.2/samples'
Afterwards I used that:

Code: Select all

C:\wxWidgets-3.0.2\build\msw>mingw32-make -f makefile.gcc BUILD=release SHARED=1
With an error:

Code: Select all

makefile.gcc:6380: recipe for target 'gcc_mswudll\wxscintilla_Editor.o' failed
mingw32-make: *** [gcc_mswudll\wxscintilla_Editor.o] Error 1
It is porbably just a tiny mistake somewhere, I just can't find...
Thanks
catalin
Moderator
Moderator
Posts: 1618
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: Building wxWidgets 3.0.2 errors

Post by catalin »

ChopStick wrote:Ok, so first at all, I deleted the whole wxWidget folder and unpacked it again. Than I cleaned it(just to make sure).

Code: Select all

C:\wxWidgets-3.0.2\build\msw>mingw32-make -f makefile.gcc BUILD=release clean -j4

Code: Select all

C:\wxWidgets-3.0.2\build\msw>mingw32-make -f makefile.gcc BUILD=release SHARED=1
SHARED is by default 0, see config.gcc, so your first call will clean-up the static libs build - but why was it even needed if you deleted everything and started anew? ..and -j4 is clearly not needed when cleaning.
The second command will obviously attempt to build the shared libs.
ChopStick wrote:

Code: Select all

makefile.gcc:6380: recipe for target 'gcc_mswudll\wxscintilla_Editor.o' failed
mingw32-make: *** [gcc_mswudll\wxscintilla_Editor.o] Error 1
In any circumstances this is not good enough. You should show the exact error where compilation failed. Look for it, it is there somewhere.
ChopStick
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed Mar 29, 2017 6:36 am

Re: Building wxWidgets 3.0.2 errors

Post by ChopStick »

Ok, this time I reinstalled the library again, and started immediately with building.
I used a different command (unless I want MONOLITHIC anyway)(See the link from my first question). And the output was pretty short:

Code: Select all

C:\wxWidgets-3.0.2\build\msw>mingw32-make SHELL=CMD.exe -j4 -f makefile.gcc BUILD=release UNICODE=1 SHARED=0 MONOLITHIC=1 CXXFLAGS="-std=gnu++11"
if not exist gcc_mswu mkdir gcc_mswu
if not exist ..\..\lib\gcc_lib mkdir ..\..\lib\gcc_lib
if not exist ..\..\lib\gcc_lib\mswu\wx\setup.h copy ..\..\include\wx\msw\setup.h ..\..\lib\gcc_lib\mswu\wx\setup.h
gcc -c -o gcc_mswu\wxregex_regcomp.o  -O2 -mthreads  -DHAVE_W32API_H -DNDEBUG -I..\..\include -I..\..\lib\gcc_lib\mswu -D__WXMSW__  -D_UNICODE   -MTgcc_mswu\wxregex_regcomp.o -MFgcc_mswu\wxregex_regcomp.o.d -MD -MP ../../src/regex/regcomp.c
Das System kann den angegebenen Pfad nicht finden.
        0 Datei(en) kopiert.
makefile.gcc:5651: recipe for target '..\..\lib\gcc_lib\mswu\wx\setup.h' failed
mingw32-make: *** [..\..\lib\gcc_lib\mswu\wx\setup.h] Error 1
mingw32-make: *** Waiting for unfinished jobs....
In file included from ..\..\include/wx/defs.h:27:0,
                 from ../../src/regex/regcustom.h:39,
                 from ../../src/regex/regguts.h:38,
                 from ../../src/regex/regcomp.c:33:
..\..\include/wx/platform.h:183:22: fatal error: wx/setup.h: No such file or directory
 #include "wx/setup.h"
                      ^
compilation terminated.
makefile.gcc:5702: recipe for target 'gcc_mswu\wxregex_regcomp.o' failed
mingw32-make: *** [gcc_mswu\wxregex_regcomp.o] Error 1
I used SHELL=CMD.exe to make 100% sure it uses the cmd of Windows.

Hope you can help me
ChopStick
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: Building wxWidgets 3.0.2 errors

Post by PB »

When using parallel building with GCC (-jX), you need to build the setup_h target first, using the same parameters you want for the real build, e.g.

Code: Select all

mingw32-make SHELL=CMD.exe -f makefile.gcc BUILD=release UNICODE=1 SHARED=0 MONOLITHIC=1 CXXFLAGS="-std=gnu++11" setup_h
ChopStick
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed Mar 29, 2017 6:36 am

Re: Building wxWidgets 3.0.2 errors

Post by ChopStick »

Looks like I don't even have got setup.h:

Code: Select all

C:\wxWidgets-3.0.2\build\msw>mingw32-make SHELL=CMD.exe -f makefile.gcc BUILD=release UNICODE=1 SHARED=0 MONOLITHIC=1 CXXFLAGS="-std=gnu++11" -j4 setup_h
if not exist ..\..\lib\gcc_lib mkdir ..\..\lib\gcc_lib
if not exist ..\..\lib\gcc_lib\mswu\wx\setup.h copy ..\..\include\wx\msw\setup.h ..\..\lib\gcc_lib\mswu\wx\setup.h
if not exist ..\..\lib\gcc_lib\mswu mkdir ..\..\lib\gcc_lib\mswu
Das System kann den angegebenen Pfad nicht finden.
        0 Datei(en) kopiert.
makefile.gcc:5651: recipe for target '..\..\lib\gcc_lib\mswu\wx\setup.h' failed
mingw32-make: *** [..\..\lib\gcc_lib\mswu\wx\setup.h] Error 1
mingw32-make: *** Waiting for unfinished jobs....
So is that something about the compiler?
User avatar
doublemax
Moderator
Moderator
Posts: 19162
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Building wxWidgets 3.0.2 errors

Post by doublemax »

Try without the -jx for now. This is just an unnecessary potential error source.

Besides: Using a MinGW version that is newer than the wxWidgets version is always critical. Use the known-to-work TDM-GCC 5.1.0 or the latest wxWidgets version from GIT.
Use the source, Luke!
ChopStick
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed Mar 29, 2017 6:36 am

Re: Building wxWidgets 3.0.2 errors

Post by ChopStick »

Alright, I tried the TDM-GCC 5.1.0 MinGW w64 compiler, and tried to build(also I reunpacked the wxWidget files).
I also deleted the old compiler from %PATH% and added the new one:

Code: Select all

C:\wxWidgets-3.0.2\build\msw>mingw32-make SHELL=CMD.exe -f makefile.gcc BUILD=release UNICODE=1 SHARED=0 MONOLITHIC=1 CXXFLAGS="-std=gnu++11"

Code: Select all

ar: gcc_swu\monolib_gdicmn.o: No such file or directory
makefile.gcc:5213: recipe for target '..\..\lib\gcc_lib\libwxmsw30u.a' failed
mingw32-make: *** [..\..\lib\gcc_lib\libwxmsw30u.a] Error 1
That didn't work...
Any other ideas?
Thanks
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: Building wxWidgets 3.0.2 errors

Post by PB »

ChopStick wrote:

Code: Select all

ar: gcc_swu\monolib_gdicmn.o: No such file or directory
That didn't work...
Any other ideas?
Thanks
When you look at the error, you can see the reason why it failed. There's an "m" missing in "gcc_swu", so it is the infamous "randomly missing letters from paths" bug caused by the command line limit of MSW. BTW, how long (how many characters) is your %PATH% and how long is the path to TDM-GCC? Besides that I have no idea how to fix it, I encountered the bug long time ago but not since, but I never build wxWidgets as monolithic nor do I use "SHELL=CMD.exe".

For example, this is a batch file I use to build wxWidgets with TDM-GCC

Code: Select all

cd %WXWIN%\build\MSW
PATH=C:\TDM-GCC-64\bin;%PATH%

mingw32-make -f makefile.gcc BUILD=debug CXXFLAGS="-std=gnu++11" setup_h
mingw32-make -j2 -f makefile.gcc BUILD=debug CXXFLAGS="-std=gnu++11"

mingw32-make -f makefile.gcc BUILD=release CXXFLAGS="-std=gnu++11" setup_h
mingw32-make -j2 -f makefile.gcc BUILD=release CXXFLAGS="-std=gnu++11"

mingw32-make -f makefile.gcc BUILD=debug SHARED=1 CXXFLAGS="-std=gnu++11" setup_h
mingw32-make -j2 -f makefile.gcc BUILD=debug SHARED=1 CXXFLAGS="-std=gnu++11"

mingw32-make -f makefile.gcc BUILD=release SHARED=1 CXXFLAGS="-std=gnu++11" setup_h
mingw32-make -j2 -f makefile.gcc BUILD=release SHARED=1 CXXFLAGS="-std=gnu++11"

pause
I use it on several PCs (running either Win7 32-bit or 64-bit) and don't really remember having any issues with either MinGW or TDM-GCC. I use GIT version of wxWidgets though.
ChopStick
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed Mar 29, 2017 6:36 am

Re: Building wxWidgets 3.0.2 errors

Post by ChopStick »

Thanks soooooo much. The first time it hasn't given me any errors in the cmd. Can you just tell me, which settings I have to enter in Code Blocks for these test librarys? There it tells me, it can't find a release or debug configuration...

Anyway, thanks already a lot.
ChopStick
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed Mar 29, 2017 6:36 am

Re: Building wxWidgets 3.0.2 errors

Post by ChopStick »

Forget about it, I just tried a bit around and enabled UNICODE and now it is working :D :D :D .
So, thank you all very much, would have cost me many sleepless nights until I would have tried it with a batch file.
Thanks one more time.

ChopStick
ChopStick
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed Mar 29, 2017 6:36 am

Re: Building wxWidgets 3.0.2 errors

Post by ChopStick »

ChopStick wrote:Hello,
I'm trying to install wxWidgets for Code Blocks(Windows). I'm using mingw w64 version 6.3.0. I have already removed and added the compiler and tried different setup combinations. Google is not helping me at all, because all the explanations on how to install wxWidgets are more or less the same.

The system variables are at C:\mingw64\mingw64\bin and I don't think I have got MSYS, at least I couldn't find it in the systemvariables.

I'm following this: https://wiki.wxwidgets.org/Compiling_wx ... with_MinGW
At the cleaning the data prompt I get "if exist"

and when I compile the library I get this:

Code: Select all

mingw32-make: *** [gcc_mswudll\wxregex_regcomp.o] Error 1
compilation terminated.
makefile.gcc:5708: recipe for target 'gcc_mswudll\wxregex_regerror.o' failed
mingw32-make: *** [gcc_mswudll\wxregex_regerror.o] Error 1
I hope you can help me,
Thanks

ChopStick
Post Reply