1

I'm feeling a bit dumb, but i can't build the new wxWidgets. I want to use codelite + mingw + wxWidgets, so i download the latest releases:

CodeLite 9.1.3 (http://downloads.codelite.org/downloads.php?windows_weekly_64)

The installer make me download the TDM-GCC-64 setup and install it.

Then i downloaded wxWidgets-3.1.0 (https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.0/wxMSW-3.1.0-Setup.exe)

Codelite detected the the compiler, now i should build the wxWidgets, but the pages i've googled for (wxW wiki, codelite docs, etc) refers to folders and files that does'nt exist. Everything is installed in the default folders, and i'm not a PC noob, while perhaps too used to environments like C++Builder etc.

What should i do now?


UPDATE

I'm sorry i'm not able to be clear. Let me try again with the output:

C:\wxWidgets-3.1.0\build\msw>mingw32-make -j8 -f Makefile.gcc SHARED=1 UNICODE=1 BUILD=release VENDOR=cl CXXFLAGS="-fno-keep-inline-dllexport -std=c++11" MONOLITHIC=1
if not exist gcc_mswudll mkdir gcc_mswudll
if not exist ..\..\lib\gcc_dll mkdir ..\..\lib\gcc_dll
if not exist ..\..\lib\gcc_dll\mswu\wx\setup.h copy ..\..\include\wx\msw\setup.h ..\..\lib\gcc_dll\mswu\wx\setup.h
gcc -c -o gcc_mswudll\wxregex_regcomp.o  -O2 -mthreads  -DHAVE_W32API_H -DNDEBUG -I..\..\include -I..\..\lib\gcc_dll\mswu -D__WXMSW__  -D_UNICODE   -MTgcc_mswudll\wxregex_regcomp.o -MFgcc_mswudll\wxre
gex_regcomp.o.d -MD -MP ../../src/regex/regcomp.c
Impossibile trovare il percorso specificato.
        0 file copiati.
Makefile.gcc:5728: recipe for target '..\..\lib\gcc_dll\mswu\wx\setup.h' failed
mingw32-make: *** [..\..\lib\gcc_dll\mswu\wx\setup.h] Error 1
mingw32-make: *** Waiting for unfinished jobs....
In file included from ..\..\include/wx/defs.h:20:0,
                 from ../../src/regex/regcustom.h:39,
                 from ../../src/regex/regguts.h:38,
                 from ../../src/regex/regcomp.c:33:
..\..\include/wx/platform.h:136:22: fatal error: wx/setup.h: No such file or directory
 #include "wx/setup.h"
                      ^
compilation terminated.
Makefile.gcc:5778: recipe for target 'gcc_mswudll\wxregex_regcomp.o' failed
mingw32-make: *** [gcc_mswudll\wxregex_regcomp.o] Error 1

I may be wrong, but seems to me that these two lines

if not exist ..\..\lib\gcc_dll mkdir ..\..\lib\gcc_dll
if not exist ..\..\lib\gcc_dll\mswu\wx\setup.h copy ..\..\include\wx\msw\setup.h ..\..\lib\gcc_dll\mswu\wx\setup.h

shows that there's a problem.

Now, i've made the directory myself and copied the setup.h in. At my home it was'nt still building, but i can't recall why, while right now, at office, it start building, but ended with this:

......
g++ -c -o gcc_mswudll\wxscintilla_LexCOBOL.o  -O2 -mthreads  -DHAVE_W32API_H -DNDEBUG -I..\..\src\stc\scintilla\include -I..\..\src\stc\scintilla\lexlib -I..\..\src\stc\scintilla\src -D__WX__ -DSCI_LE
XER -DLINK_LEXERS -I..\..\lib\gcc_dll\mswu -I..\..\include  -D__WXMSW__   -D_UNICODE    -fno-keep-inline-dllexport -std=c++11 -MTgcc_mswudll\wxscintilla_LexCOBOL.o -MFgcc_mswudll\wxscintilla_LexCOBOL.
o.d -MD -MP ../../src/stc/scintilla/lexers/LexCOBOL.cxx
In file included from c:\sviluppo\tools\mingw\lib\gcc\mingw32\4.8.1\include\c++\cmath:44:0,
                 from c:\sviluppo\tools\mingw\lib\gcc\mingw32\4.8.1\include\c++\random:38,
                 from c:\sviluppo\tools\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:65,
                 from c:\sviluppo\tools\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62,
                 from ../../src/stc/scintilla/lexers/LexBibTeX.cxx:18:
c:\sviluppo\tools\mingw\include\math.h: In function 'float hypotf(float, float)':
c:\sviluppo\tools\mingw\include\math.h:635:30: error: '_hypot' was not declared in this scope
 { return (float)(_hypot (x, y)); }
                              ^
g++ -c -o gcc_mswudll\wxscintilla_LexCoffeeScript.o  -O2 -mthreads  -DHAVE_W32API_H -DNDEBUG -I..\..\src\stc\scintilla\include -I..\..\src\stc\scintilla\lexlib -I..\..\src\stc\scintilla\src -D__WX__ -
DSCI_LEXER -DLINK_LEXERS -I..\..\lib\gcc_dll\mswu -I..\..\include  -D__WXMSW__   -D_UNICODE    -fno-keep-inline-dllexport -std=c++11 -MTgcc_mswudll\wxscintilla_LexCoffeeScript.o -MFgcc_mswudll\wxscint
illa_LexCoffeeScript.o.d -MD -MP ../../src/stc/scintilla/lexers/LexCoffeeScript.cxx
Makefile.gcc:6183: recipe for target 'gcc_mswudll\wxscintilla_LexBibTeX.o' failed
mingw32-make: *** [gcc_mswudll\wxscintilla_LexBibTeX.o] Error 1
mingw32-make: *** Waiting for unfinished jobs....

C:\wxWidgets-3.1.0\build\msw>

So, we're still not building the wxWidgets.


UPDATE:

tried to make a debug build as suggested in the answer. this is the output:

C:\wxWidgets-3.1.0\build\msw> mingw32-make -j8 -f Makefile.gcc SHARED=1 UNICODE=
1 BUILD=debug VENDOR=cl CXXFLAGS="-fno-keep-inline-dllexport -std=c++11" MONOLIT
HIC=1
if not exist gcc_mswuddll mkdir gcc_mswuddll
if not exist ..\..\lib\gcc_dll\mswud mkdir ..\..\lib\gcc_dll\mswud
if not exist ..\..\lib\gcc_dll\mswud\wx\setup.h copy ..\..\include\wx\msw\setup.
h ..\..\lib\gcc_dll\mswud\wx\setup.h
gcc -c -o gcc_mswuddll\wxregex_regcomp.o -g -O0 -mthreads  -DHAVE_W32API_H -DNDE
BUG -I..\..\include -I..\..\lib\gcc_dll\mswud -D__WXMSW__  -D_UNICODE   -MTgcc_m
swuddll\wxregex_regcomp.o -MFgcc_mswuddll\wxregex_regcomp.o.d -MD -MP ../../src/
regex/regcomp.c
Impossibile trovare il percorso specificato.
        0 file copiati.
Makefile.gcc:5728: recipe for target '..\..\lib\gcc_dll\mswud\wx\setup.h' failed

mingw32-make: *** [..\..\lib\gcc_dll\mswud\wx\setup.h] Error 1
mingw32-make: *** Waiting for unfinished jobs....
In file included from ..\..\include/wx/defs.h:20:0,
                 from ../../src/regex/regcustom.h:39,
                 from ../../src/regex/regguts.h:38,
                 from ../../src/regex/regcomp.c:33:
..\..\include/wx/platform.h:136:22: fatal error: wx/setup.h: No such file or dir
ectory
compilation terminated.
Makefile.gcc:5778: recipe for target 'gcc_mswuddll\wxregex_regcomp.o' failed
mingw32-make: *** [gcc_mswuddll\wxregex_regcomp.o] Error 1

The file is there, so i don't know what's the problem...

C:\wxWidgets-3.1.0\build\msw>dir ..\..\src\regex\regcomp.*
 Il volume nell'unità C è 1TBWD-1-WIN7 64
 Numero di serie del volume: A26D-1E3B

 Directory di C:\wxWidgets-3.1.0\src\regex

28/02/2016  22:33            59.702 regcomp.c
               1 File         59.702 byte
               0 Directory  74.986.561.536 byte disponibili

C:\wxWidgets-3.1.0\build\msw>
Parduz
  • 662
  • 5
  • 22

4 Answers4

1

The installer make me download the TDM-GCC-64 setup and install it.

CodeLite suggests...

What should i do now?

Build wxWidgets like this:

After you have built wxWidgets, you need to set 2 environment variables in CodeLite from: (Settings->Environment variables):

WXCFG=gcc_dll\mswu WXWIN=\path\to\wxWidgets

If you attempt to build the Debug configuration of your project in CodeLite, you should do ONE of the following:

Build a debug version of wxWidgets (this is what CodeLite will search)

OR

Remove --debug flag from the compiler and linker options:

  1. Project Settings->Compiler->C++ Compiler Options, and remove the part that says --debug=yes or just --debug
  2. Project Settings->Linker->Linker options, and remove the part that says --debug=yes or just --debug

EDIT: Update CodeLite's wiki page link

EDIT2: Added PATH instructions to the answer

EDIT3: Added instructions on how to set the environment variables WXCFG and WXWIN

Eran

Eran
  • 2,310
  • 1
  • 13
  • 13
  • The .7z file contains the same exact files of the installer. The linked page is what i was trying to follow. - there's no folders in the \path\to\wxwidgets\lib\gcc_dll\ (the gcc_dll was created by the build command, but there's nothing in it) - the only setup.h files are in the "include" folder. I mean: i was exactly with what you told me to do BEFORE opening this question :) – Parduz Mar 07 '16 at 08:34
  • There is a big comment on http://codelite.org/Developers/BuildingWxWidgetsWin#toc2 starting with "If the file \path\to\wxwidgets\lib\gcc_dll\mswu\wx\setup.h....", basically what it says: "Start the build, wait for a few seconds, and then cancel it" and you will find the `setup.h` file – Eran Mar 07 '16 at 11:46
  • I updated my answer: I added new section in wiki (link updated in my original answer) - since you don't plan on building CodeLite, you can skip some of the steps - wiki page updated with new section "Building wxWidgets for general purposes" – Eran Mar 07 '16 at 11:51
  • updated the question 'cause was too long for a comment. – Parduz Mar 07 '16 at 12:55
  • According to the first post, you installed MinGW suggested by CodeLite, i.e. you should have GCC5.X, however, according to the build log, you are using MinGW 4.8.1. Please update `PATH` environment variable to the proper MinGW toolchain like this (from the CMD): `set path=\path\to\mingw\bin;%path%` - I have also updated my original answer – Eran Mar 07 '16 at 17:09
  • That was 'cause i took the output from my office, where i have an older MinGW. Now i'm at home again, the path was already set, but it did'nt build anyway. To be sure, i uninstalled the wxWidgets and installed them again to start from "scratch", and this time the build was succesfull, but only after these two commands: `C:\wxWidgets-3.1.0\build\msw>mkdir ..\..\lib\gcc_dll\mswu\wx\ C:\wxWidgets-3.1.0\build\msw>copy ..\..\include\wx\msw\setup.h ..\..\lib\gcc_dll \mswu\wx\setup.h 1 file copiati.` – Parduz Mar 08 '16 at 01:25
  • While we're here: how should i set the WXCFG variable in Codelite? `Please use the --wxcfg flag (as in wx-config --wxcfg=gcc_dll/mswud) or set the environment variable WXCFG (as in WXCFG=gcc_dll/mswud) to specify which configuration exactly you want to use.` – Parduz Mar 08 '16 at 01:26
  • 1
    This seems like a never ending story. Erased everything and reinstalled the wxWidgets, to start from a clean situation, and tried to build a debug version of them. This time it creates the right folders, but then stops on the regcomp.c. The file is there, i don't understand what was wrong this time. Question updated with the output. – Parduz Mar 09 '16 at 23:27
1

As for today, the build forget to make two directories. The solution is to make them yourself before building.

So my solution is to go to your wxWidget folder and type:

C:\wxWidgets-3.1.0>mkdir lib\gcc_dll\mswu\wx\
C:\wxWidgets-3.1.0>copy include\wx\msw\setup.h lib\gcc_dll\mswu\wx\setup.h
Parduz
  • 662
  • 5
  • 22
1

There is a bug in makefile.gcc when using parallel make (i.e. with -j8). A workaround is to do

mingw32-make <all the same options> setup_h

first followed by the normal make command. Another alternative is to use configure-based build which doesn't suffer from this problem.

The compilation problem with _hypot() is due to a compiler bug and we've tried to work around it in this commit, but apparently it wasn't enough. You should report the problem with more details, including the version of the compiler you use and the options passed to make.

VZ.
  • 21,740
  • 3
  • 39
  • 42
0

I had a similar problem using this command

mingw32-make -j8 -f Makefile.gcc SHARED=1 UNICODE=1 BUILD=release VENDOR=cl CXXFLAGS="-fno-keep-inline-dllexport -std=c++11" MONOLITHIC=1

Problem is -j8 which considers number of physical processors before the build process commences.

Try -jN (replace N to value of NUMBER_OF_PROCESSORS)

mingw32-make looks at actual number of physical processors, hyper-threaded or virtual processors are not consider. If however your machine has less than assigned physical processors, it causes error.

You can also try putting just -j into the make arguments field. That tells Make to spawn as many compile processes as it can if you have enough RAM and CPU to handle that, it should be faster than a single compile.

I successfully tried with -j4 on i7 which has 4 physical processors.

( Note : when hyper-threading is turned on i7 shows 8 virtual processors )

Something similar is mentioned by Orient here

A better explain by Brendan Shanks is mentioned here.

  • The problem is indeed due to the use of `-jN` as [already mentioned](https://stackoverflow.com/a/35867279/15275), but the explanation is just completely wrong on many levels (mingw32-make is not a compiler, core number detection doesn't come into play at all here, all logical cores would be counted if they were and the problem can occur perfectly well with `-j4` too, it's just a bit less likely to happen). – VZ. Sep 05 '17 at 23:09
  • I know of the problem 'jN' is already mentioned but there was no clear workaround or solution to the immediate problem. The only reason I wrote a solution was to help people tackle this issue with ease. My trial and error shows that I failed with 'j8' but same command worked with 'j4'. Take a look at this solution [link](https://stackoverflow.com/a/12912354/6391016) which clearly mentions something similar. – Vertigo cache Sep 06 '17 at 15:41
  • The workaround for this problem was given in the [already linked answer](https://stackoverflow.com/a/35867279/15275) just above. – VZ. Sep 07 '17 at 10:43