Can't build the new wxWidgets. What should i do?

那年仲夏 提交于 2019-12-13 05:32:10

问题


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>

回答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:

  • Download wxWidgets sources https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.0/wxWidgets-3.1.0.7z

  • Build wxWidgets as described on CodeLite's wiki page

  • Install a decent compiler (Recommended: MinGW TDM-GCC 5.X series)
  • When you open the CMD to build, type this: set path=\path\to\MinGW\bin;%path%

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




回答2:


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



回答3:


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.




回答4:


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.



来源:https://stackoverflow.com/questions/35830478/cant-build-the-new-wxwidgets-what-should-i-do

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!