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.
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.
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.
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.
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:
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.
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....
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.
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:
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
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
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.
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...
Forget about it, I just tried a bit around and enabled UNICODE and now it is working .
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 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.