setup.h error again when building wxwidgets 3.1.2

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
djsbriscoe
Earned a small fee
Earned a small fee
Posts: 24
Joined: Mon Mar 24, 2008 3:12 pm
Location: London,UK

setup.h error again when building wxwidgets 3.1.2

Post by djsbriscoe »

I am following the instructions in

viewtopic.php?f=19&t=46125

However at the point where I issue the command
mingw32-make -f makefile.gcc SHARED=0 BUILD=debug MONOLITHIC=0
I get the following error
C:\WxWidgets-3.1.2\build\msw>mingw32-make -f makefile.gcc SHARED=0 BUILD=debug MONOLITHIC=0
if not exist gcc_mswud mkdir gcc_mswud
if not exist ..\..\lib\gcc_lib mkdir ..\..\lib\gcc_lib
if not exist ..\..\lib\gcc_lib\mswud mkdir ..\..\lib\gcc_lib\mswud
if not exist ..\..\lib\gcc_lib\mswud\wx mkdir ..\..\lib\gcc_lib\mswud\wx
if not exist ..\..\lib\gcc_lib\mswud\wx\setup.h copy ..\..\include\wx\msw\setup.h ..\..\lib\gcc_lib\mswud\wx\setup.h
if not exist ..\..\lib\gcc_lib\mswud\wx\msw mkdir ..\..\lib\gcc_lib\mswud\wx\msw
gcc -E "..\..\include\wx\msw\genrcdefs.h" > "..\..\lib\gcc_lib\mswud\wx\msw\rcdefs.h"
gcc -c -o gcc_mswud\wxregex_regcomp.o -g -O0 -mthreads -DHAVE_W32API_H -DNDEBUG -I..\..\include -I..\..\lib\gcc_lib\mswud -D__WXMSW__ -D_UNICODE -MTgcc_mswud\wxregex_regcomp.o -MFgcc_mswud\wxregex_regcomp.o.d -MD -MP ../../src/regex/regcomp.c
In file included from ..\..\include/wx/defs.h:45:0,
from ../../src/regex/regcustom.h:39,
from ../../src/regex/regguts.h:38,
from ../../src/regex/regcomp.c:33:
..\..\include/wx/platform.h:148:22: fatal error: wx/setup.h: No such file or directory
compilation terminated.
makefile.gcc:5787: recipe for target 'gcc_mswud\wxregex_regcomp.o' failed
mingw32-make: *** [gcc_mswud\wxregex_regcomp.o] Error 1

C:\WxWidgets-3.1.2\build\msw>
I have come across this error before but I have lost the notes on how I solved the problem last time (it over a year since solved it).
I did notice that if I manually create a folder (I created the gcc_mswud folder mentioned on the first line above) then the first line above vanished on running the command again. I have discovered that windows 10 folders are anoyingly persisting in staying read only. Maybe this is the problem?
Does anyone know what the directory structure is beyond the top \build\msw so that I can create the directories myself?
Any other help would be appreciated. Thanks.

David.
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 550
Joined: Fri Nov 03, 2006 2:00 pm

Re: setup.h error again when building wxwidgets 3.1.2

Post by stahta01 »

Try building setup.h first; the problem you got is common if more than one make job is running at a time.

Code: Select all

mingw32-make -f makefile.gcc SHARED=0 BUILD=debug MONOLITHIC=0 setup_h
Tim S.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: setup.h error again when building wxwidgets 3.1.2

Post by PB »

While missing "setup.h" would suggest issue stemming from a parallel build, in what the op posted, I do not see a parameter (-jN) indicating a parallel build?

Anyway, I can suggest two things:
1. Make sure the build is clean, i.e., there are no leftovers from a previous build.
2. Use wxWidgets 3.1.3 instead. 3.1.2 has (also) an I18N bug and additionally, 3.1.3 makefiles use a response file which prevents the missing letter bug.

FWIW, I have never had to set any access permissions when building wxWidgets and I would assume that everything inside your C:\WxWidgets-3.1.2 would be writable unless set otherwise by yourself or an overly zealous 3rd party malware protection.
djsbriscoe
Earned a small fee
Earned a small fee
Posts: 24
Joined: Mon Mar 24, 2008 3:12 pm
Location: London,UK

Re: setup.h error again when building wxwidgets 3.1.2

Post by djsbriscoe »

The number of errors is gradually reducing.Now I get
C:\wxWidgets-3.1.2\build\msw>mingw32-make -f makefile.gcc SHARED=0 BUILD=debug MONOLITHIC=0 setup_h
if not exist ..\..\lib\gcc_lib\mswud\wx\msw mkdir ..\..\lib\gcc_lib\mswud\wx\msw
gcc -E "..\..\include\wx\msw\genrcdefs.h" > "..\..\lib\gcc_lib\mswud\wx\msw\rcdefs.h"

C:\wxWidgets-3.1.2\build\msw>mingw32-make -f makefile.gcc SHARED=0 BUILD=debug MONOLITHIC=0
if not exist ..\..\lib\gcc_lib\mswud\wx\msw mkdir ..\..\lib\gcc_lib\mswud\wx\msw
gcc -E "..\..\include\wx\msw\genrcdefs.h" > "..\..\lib\gcc_lib\mswud\wx\msw\rcdefs.h"
gcc -c -o gcc_mswud\wxregex_regcomp.o -g -O0 -mthreads -DHAVE_W32API_H -DNDEBUG -I..\..\include -I..\..\lib\gcc_lib\mswud -D__WXMSW__ -D_UNICODE -MTgcc_mswud\wxregex_regcomp.o -MFgcc_mswud\wxregex_regcomp.o.d -MD -MP ../../src/regex/regcomp.c
makefile.gcc:5787: recipe for target 'gcc_mswud\wxregex_regcomp.o' failed
mingw32-make: *** [gcc_mswud\wxregex_regcomp.o] Error 1

C:\wxWidgets-3.1.2\build\msw>
With the setup_h the errors have reduced to 2 lines (I've created the directoryit's asking for but it still is NOT recognised)

Without the setup_h I get an

as.exe Entry point not found.

I've looked for a conflicting mingw installation but there is none. At least some progress is being made.

I'll try 3.1.3 as well later.
djsbriscoe
Earned a small fee
Earned a small fee
Posts: 24
Joined: Mon Mar 24, 2008 3:12 pm
Location: London,UK

Re: setup.h error again when building wxwidgets 3.1.2

Post by djsbriscoe »

Just uninstalled 3.1.2 (with a proper installer that cleans up directories etc) and installed 3.1.3. This is what I get
Microsoft Windows [Version 10.0.18363.657]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>cd C:\wxwidgets-3.1.3\build\msw\

C:\wxWidgets-3.1.3\build\msw>mingw32-make -f makefile.gcc SHARED=0 BUILD=debug MONOLITHIC=0 setup_h
if not exist ..\..\lib\gcc_lib mkdir ..\..\lib\gcc_lib
if not exist ..\..\lib\gcc_lib\mswud mkdir ..\..\lib\gcc_lib\mswud
if not exist ..\..\lib\gcc_lib\mswud\wx mkdir ..\..\lib\gcc_lib\mswud\wx
if not exist ..\..\lib\gcc_lib\mswud\wx\setup.h copy ..\..\include\wx\msw\setup.h ..\..\lib\gcc_lib\mswud\wx\setup.h
if not exist ..\..\lib\gcc_lib\mswud\wx\msw mkdir ..\..\lib\gcc_lib\mswud\wx\msw
gcc -E "..\..\include\wx\msw\genrcdefs.h" > "..\..\lib\gcc_lib\mswud\wx\msw\rcdefs.h"

C:\wxWidgets-3.1.3\build\msw>
I will try the same command tomorrow as I suspect the compilation will take all night if it goes ahead. More later.
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 550
Joined: Fri Nov 03, 2006 2:00 pm

Re: setup.h error again when building wxwidgets 3.1.2

Post by stahta01 »

NOTE: If you have ever used MONOLITHIC=1 in that wxWidgets folder; and then changed to MONOLITHIC=0.
The build will likely never work; till you delete the folder because I have never gotten clean to delete something that caused to build to fail for me. Note: Doing a clean with MONOLITHIC=1 (prior value) should fix the problem; but, I do not remember if I tried that the last time I had the issue.

Tim S.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: setup.h error again when building wxwidgets 3.1.2

Post by PB »

djsbriscoe wrote: Sun Feb 16, 2020 11:04 pm Just uninstalled 3.1.2 (with a proper installer that cleans up directories etc) and installed 3.1.3. This is what I get
...
That is actually OK. You built only the setup_h target. You need to build wWidgets libraries now.

Anyway, setup_h target needs to be built separately only when using a parallel build which can significantly speed up the build process (using -jN parameter), e.g. assuming you have (at least) 4 CPU cores available on your system

Code: Select all

mingw32-make -f makefile.gcc setup_h
mingw32-make -f makefile.gcc -j4
See the NOTE at the end of the Using plain makefiles section here for explanation.

BTW, a static multilib debug build is default, so one does not need to specify "SHARED=0 BUILD=debug MONOLITHIC=0"
djsbriscoe
Earned a small fee
Earned a small fee
Posts: 24
Joined: Mon Mar 24, 2008 3:12 pm
Location: London,UK

Re: setup.h error again when building wxwidgets 3.1.2

Post by djsbriscoe »

Now I get the following errors
C:\wxWidgets-3.1.3\build\msw>mingw32-make -f makefile.gcc
gcc -c -o gcc_mswud\wxregex_regcomp.o -g -O0 -mthreads -DHAVE_W32API_H -DNDEBUG -I..\..\include -I..\..\lib\gcc_lib\mswud -D__WXMSW__ -D_UNICODE -MTgcc_mswud\wxregex_regcomp.o -MFgcc_mswud\wxregex_regcomp.o.d -MD -MP ../../src/regex/regcomp.c
makefile.gcc:5926: recipe for target 'gcc_mswud\wxregex_regcomp.o' failed
mingw32-make: *** [gcc_mswud\wxregex_regcomp.o] Error 1

C:\wxWidgets-3.1.3\build\msw>
Then an as.exe entry point not found error (if I use the -j4 flag i get the same errors above but 4 more times and the as.exe 4 times). There are two versions of as.exe. One is in the MinGW directory and the other is in the MinGW32 directory.
Error_messsage.jpg
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: setup.h error again when building wxwidgets 3.1.2

Post by PB »

Firstly, I am not even sure if 3.1.3 can be built with ancient GCC 5.1, see the post-release bug fix here.

However, the bug you posted (a crash) looks as either there is something wrong with your system or you are mixing multiple installations of GCC tool chain.

Are you really sure there is no other GCC in the PATH? Did you use where to verify it, e.g. while being in the command line, type

Code: Select all

where gcc.exe
and the only result you should get is the one inside the Code::Blocks folder.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: setup.h error again when building wxwidgets 3.1.2

Post by ONEEYEMAN »

Hi,
Also, can you post the result of:

Code: Select all

set 
Thank you.
djsbriscoe
Earned a small fee
Earned a small fee
Posts: 24
Joined: Mon Mar 24, 2008 3:12 pm
Location: London,UK

Re: setup.h error again when building wxwidgets 3.1.2

Post by djsbriscoe »

Here are the results of the where and set commands respectively.
C:\WINDOWS\system32>where gcc.exe
C:\Program Files (x86)\CodeBlocks\MinGW\bin\gcc.exe

C:\WINDOWS\system32>set
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\David\AppData\Roaming
CARBON_MEM_DISABLE=1
ChocolateyInstall=C:\ProgramData\chocolatey
ChocolateyLastPathUpdate=Sun Aug 6 09:51:12 2017
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=DJSB-LAPTOP
ComSpec=C:\WINDOWS\system32\cmd.exe
DriverData=C:\Windows\System32\Drivers\DriverData
GPUTILS_HEADER_PATH=C:\Program Files (x86)\gputils\header
GPUTILS_LKR_PATH=C:\Program Files (x86)\gputils\lkr
GTK_BASEPATH=C:\Program Files (x86)\GtkSharp\2.12\
HOME=C:\Users\David\AppData\Roaming\SPB_Data
HOMEDRIVE=C:
HOMEPATH=\Users\David
IntelliJ IDEA Community Edition=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.3.4\bin;
KEYSHOT_EXTERNAL_LICENSE_FOLDER=C:\Program Files\Alibre Design\Program\
LOCALAPPDATA=C:\Users\David\AppData\Local
LOGONSERVER=\\DJSB-LAPTOP
NUMBER_OF_PROCESSORS=8
OneDrive=C:\Users\David\OneDrive
OneDriveConsumer=C:\Users\David\OneDrive
OS=Windows_NT
Path=C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Python27\;C:\Python27\Scripts;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files (x86)\Microchip\xc8\v1.42\bin;C:\Program Files\doxygen\bin;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\PuTTY\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Users\David\Documents\dev\fltk-1.3.4-2-source\fluid\;C:\Program Files (x86)\Microchip\xc8\v1.45\bin;C:\WINDOWS\System32\OpenSSH\;C:\Users\David\.cargo\bin;C:\Program Files (x86)\AOMEI Backupper;C:\Program Files (x86)\Microchip\xc8\v2.00\bin;C:\Program Files (x86)\Microchip\xc8\v2.05\bin;C:\Program Files (x86)\Microchip\xc16\v1.35\bin;C:\Program Files\Java\jdk1.8.0_112\bin;C:\Program Files\CMake\bin;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Program Files (x86)\Microchip\xc8\v2.10\bin;C:\Program Files\TortoiseGit\bin;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\Users\David\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Silicon Laboratories\ClockBuilder Pro\Bin;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.3.4\bin;C:\Users\David\AppData\Local\Programs\Microsoft VS Code\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 94 Stepping 3, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=5e03
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
PUBLIC=C:\Users\Public
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\Users\David\AppData\Local\Temp
TMP=C:\Users\David\AppData\Local\Temp
USERDOMAIN=DJSB-LAPTOP
USERDOMAIN_ROAMINGPROFILE=DJSB-LAPTOP
USERNAME=David
USERPROFILE=C:\Users\David
VBOX_MSI_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\
windir=C:\WINDOWS
XILINX_FOR_ALTIUM_OVERRIDE=
I have just renamed the MinGW32 directory and the Wxwidget library is now compiling. I don't know why this should be needed as only MinGW is in the PATH as shown above. Thank you for all your replies and help. I will let you all know if and when everything works out as I try to compile a sample project.
Last edited by djsbriscoe on Tue Feb 18, 2020 10:04 pm, edited 1 time in total.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: setup.h error again when building wxwidgets 3.1.2

Post by PB »

Mm, I have no idea what is wrong.

Regarding PATH: I never add build tools globally to the PATH, I do that only in the batch file building the libraries and I add the compiler folder it at the very beginning of the PATH, i.e. something like this

Code: Select all

set PATH=C:\Program Files (x86)\mingw-w64\i686-8.1.0-win32-sjlj-rt_v6-rev0\mingw32\bin;%PATH%
Post Reply