Win7: compiled wxWidgets 3.1.3, cannot build "minimal" sample.

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
Glitch
Earned a small fee
Earned a small fee
Posts: 13
Joined: Fri Mar 27, 2020 9:54 am

Win7: compiled wxWidgets 3.1.3, cannot build "minimal" sample.

Post by Glitch » Fri Mar 27, 2020 11:31 am

Hello.
I followed the instructions linked in this thread:
viewtopic.php?f=19&t=46125
for compiling the Widgets (i don't plan to use Code::blocks, so I have just followed the compiling part), and at the end it worked (despite a lot of warnings about "implicitly-declared" something is deprecated ... is this normal?)

But i can't buiild the minimal example.

This is how i compiled the widgets:

Code: Select all

C:\SVILUPPO\wxWidgets-3.1.3\build\msw>mingw32-make -f makefile.gcc CXXFLAGS="-std=gnu++11" USE_XRC=1 SHARED=0 MONOLITHIC=0 BUILD=release CFG=REL_9201
This is what i get when i try to build "minimal" (i tried various things, i post them all, but the one following the tutorial is the first):

Code: Select all

C:\SVILUPPO\wxWidgets-3.1.3\samples\minimal>mingw32-make -f makefile.gcc CXXFLAGS="-std=gnu++11" USE_XRC=1 SHARED=0 MONOLITHIC=0 BUILD=release CFG=REL_9201
makefile.gcc:8: build.cfg: No such file or directory
mingw32-make: *** No rule to make target 'build.cfg'.  Stop.

Code: Select all

C:\SVILUPPO\wxWidgets-3.1.3\samples\minimal>mingw32-make -f makefile.gcc
makefile.gcc:8: build.cfg: No such file or directory
mingw32-make: *** No rule to make target 'build.cfg'.  Stop.

Code: Select all

C:\SVILUPPO\wxWidgets-3.1.3\samples\minimal>mingw32-make -f minimal
mingw32-make: minimal: No such file or directory
g++     minimal.cpp   -o minimal
minimal.cpp:20:10: fatal error: wx/wxprec.h: No such file or directory
   20 | #include "wx/wxprec.h"
      |          ^~~~~~~~~~~~~
compilation terminated.
<builtin>: recipe for target 'minimal' failed
mingw32-make: *** [minimal] Error 1

Code: Select all

C:\SVILUPPO\wxWidgets-3.1.3\samples\minimal>mingw32-make -f minimal CXXFLAGS="-std=gnu++11" USE_XRC=1 SHARED=0 MONOLITHIC=0 BUILD=release CFG=REL_9201
mingw32-make: minimal: No such file or directory
g++ -std=gnu++11    minimal.cpp   -o minimal
minimal.cpp:20:10: fatal error: wx/wxprec.h: No such file or directory
   20 | #include "wx/wxprec.h"
      |          ^~~~~~~~~~~~~
compilation terminated.
<builtin>: recipe for target 'minimal' failed
mingw32-make: *** [minimal] Error 1

What should i look for?

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2463
Joined: Sun Jan 03, 2010 5:45 pm

Re: Win7: compiled wxWidgets 3.1.3, cannot build "minimal" sample.

Post by PB » Fri Mar 27, 2020 4:34 pm

Did you verify that wxWidgets built successfully? Is file build.cfg in your WXWIN/lib/gcc_libREL_9201/mswu folder?

EDIT
I have just tried with your exact build parameters and I could build the minimal sample as well.

wxWidgets 3.1.3, mingw-64 i686-8.1.0-win32-sjlj-rt_v6-rev0, Win10

BTW, these are the built libraries in my WXWIN/lib/gcc_libREL_9201 folder (and build.cfg is there as well in its mswu subfolder)
gcc_libREL_9201.png
gcc_libREL_9201.png (25.87 KiB) Viewed 527 times

Glitch
Earned a small fee
Earned a small fee
Posts: 13
Joined: Fri Mar 27, 2020 9:54 am

Re: Win7: compiled wxWidgets 3.1.3, cannot build "minimal" sample.

Post by Glitch » Fri Mar 27, 2020 6:41 pm

PB wrote:
Fri Mar 27, 2020 4:34 pm
Did you verify that wxWidgets built successfully? Is file build.cfg in your WXWIN/lib/gcc_libREL_9201/mswu folder?
Yup, it's there:

Code: Select all

C:\SVILUPPO\wxWidgets-3.1.3\samples\minimal>dir %WX_LIBS%

Il volume nell'unità C è 1TBWD-1-WIN7 64
Numero di serie del volume: A26D-1E3B
Directory di C:\SVILUPPO\wxWidgets-3.1.3\lib\gcc_libREL_9201\mswu
27/03/2020  11:58    <DIR>          .
27/03/2020  11:58    <DIR>          ..
27/03/2020  11:58               582 build.cfg
27/03/2020  11:04    <DIR>          wx
               1 File            582 byte
               3 Directory  50.284.896.256 byte disponibili
PB wrote:
Fri Mar 27, 2020 4:34 pm
wxWidgets 3.1.3, mingw-64 i686-8.1.0-win32-sjlj-rt_v6-rev0, Win10
Trying to be helpful, here's how my PC is:

Code: Select all

C:\SVILUPPO\wxWidgets-3.1.3\samples\minimal>set

ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\Glitch\AppData\Roaming
AV_APPDATA=C:\Users\Glitch\AppData\Roaming
CLASSPATH=.;C:\Program Files (x86)\Java\jre1.8.0_40\lib\ext\QTJava.zip
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=Glitch-PC
Comp_Version=REL_9201
ComSpec=C:\windows\system32\cmd.exe
C_EM64T_REDIST11=C:\Program Files (x86)\Common Files\Intel\Shared Files\cpp\
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Users\Glitch
JD2_HOME=C:\Users\Glitch\AppData\Local\JDownloader 2.0
KMP_DUPLICATE_LIB_OK=TRUE
LOCALAPPDATA=C:\Users\Glitch\AppData\Local
LOGONSERVER=\\Glitch-PC
NUMBER_OF_PROCESSORS=4
OS=Windows_NT
Path=C:\SVILUPPO\MinGWGet\bin;C:\SVILUPPO\wxWidgets-3.1.3\lib\gcc_libREL_9201\mswu;C:\SVILUPPO\wxWidgets-3.1.3\include;C:\Program Files\ImageMagick-7.0.8-Q16;C:\Program Files (x86)\Python37-32\Scripts\;C:\Program Files (x86)\Python37-32\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Intel\Shared Files\cpp\bin\Intel64;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\QuickTime\QTSystem\;C:\ffmpeg\bin;C:\TDM-GCC-64\bin;C:\Users\Glitch\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\Glitch\AppData\Roaming\npm
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 37 Stepping 2, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=2502
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC=C:\Users\Public
QTJAVA=C:\Program Files (x86)\Java\jre1.8.0_40\lib\ext\QTJava.zip
SystemDrive=C:
SystemRoot=C:\windows
TEMP=C:\Users\Glitch\AppData\Local\Temp
TMP=C:\Users\Glitch\AppData\Local\Temp
USERDOMAIN=Glitch-PC
USERNAME=Glitch
USERPROFILE=C:\Users\Glitch
VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
VSSDK140Install=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VSSDK\
windir=C:\windows
WXWIN=C:\SVILUPPO\wxWidgets-3.1.3
WX_INCLUDE=C:\SVILUPPO\wxWidgets-3.1.3\include
WX_LIBS=C:\SVILUPPO\wxWidgets-3.1.3\lib\gcc_libREL_9201\mswu
GCC version:

Code: Select all

C:\SVILUPPO\wxWidgets-3.1.3\samples\minimal>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/sviluppo/mingwget/bin/../libexec/gcc/mingw32/9.2.0/lto-wrapper.exe
Target: mingw32
Configured with: ../src/gcc-9.2.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --target=mingw32 --disable-win32-registry --with-arch=i586 --with-tune=generic --enable-static --enable-shared -- enable-threads --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --enable-libgomp --disable-libvtv --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --disable-build-format-warnings --prefix=/mingw --with-gmp=/mingw --with-mpfr=/mingw --with-mpc=/mingw --with-isl=/mingw --enable-nls --with-pkgversion='MinGW.org GCC Build-20200227-1'
Thread model: win32
gcc version 9.2.0 (MinGW.org GCC Build-20200227-1)
PB wrote:
Fri Mar 27, 2020 4:34 pm
BTW, these are the built libraries in my WXWIN/lib/gcc_libREL_9201 folder (and build.cfg is there as well in its mswu subfolder)
gcc_libREL_9201.png
Same:
lib.png
lib.png (18.97 KiB) Viewed 518 times
Thanks.

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2463
Joined: Sun Jan 03, 2010 5:45 pm

Re: Win7: compiled wxWidgets 3.1.3, cannot build "minimal" sample.

Post by PB » Sat Mar 28, 2020 6:47 pm

Looks fine to me. The only thing that may be problematic is your GCC is 9.2. Very new MinGW versions are known to have problems with wxWidgets. But they are usually different kind of problems than you have. I doubt Win7 vs Win10 makes any difference here, so the only difference is the build toolchain. There could always be an issue on your system (drive failure, overeager antivirus, folder permissions...) but these are difficult to diagnose remotely.

By the way, I assume you tried building other samples as well, with the same result?

All I can suggest is:
Delete all build files (from WXWIN/lib/gcc_*, WXWIN/build/msw/gcc_*, and WXWIN/samples/minimal/gcc_*) and try again. Perhaps also trying the default build (without any parameters, i.e., debug static build) and see what happens could help.

I am not that familiar with MinGW but are you using the one intended to be used with GCC makefiles and not the one for configure (=MSYS)?

Where exactly did you obtain your MinGW, I could try with the same one and see if the issue happens to me too...

BTW, the two wxWidgets folders you added to the PATH serve no purpose there.

EDIT
I just tried with the same MinGW you have (obtained via https://osdn.net/projects/mingw/downloa ... setup.exe/) and all still went well. Must be something on your setup...

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 365
Joined: Fri Nov 03, 2006 2:00 pm

Re: Win7: compiled wxWidgets 3.1.3, cannot build "minimal" sample.

Post by stahta01 » Sat Mar 28, 2020 8:54 pm

I could not duplicate the problem using the MinGW.org GCC of same version as poster.

NOTE: This compiler likely has issues if a different compiler is in C:\mingw folder.

I would guess a corrupt or edited makefile.gcc or config.gcc is the cause of the posters problem.

Tim S.

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2463
Joined: Sun Jan 03, 2010 5:45 pm

Re: Win7: compiled wxWidgets 3.1.3, cannot build "minimal" sample.

Post by PB » Sat Mar 28, 2020 9:00 pm

stahta01 wrote:
Sat Mar 28, 2020 8:54 pm
I would guess a corrupt or edited makefile.gcc or config.gcc is the cause of the posters problem.
But those are shared between the library and samples, and the library build just fine?

I did not see any c:\MinGW in the OP's setup (for some reason, he seems to have it installed in C:\SVILUPPO\MinGWGet) but I noticed TDM-GCC-64 in the PATH. MinGW preceding it in the PATH should prevent any issues, but just to be sure I would remove it from there.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4228
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Win7: compiled wxWidgets 3.1.3, cannot build "minimal" sample.

Post by ONEEYEMAN » Sat Mar 28, 2020 10:05 pm

Hi,
Mixing 2 MinGW compilers in the PATH on one computer is not a good idea.

It is best to remove one completely (not just from the $PAtH) and try again.

Thank you.

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 365
Joined: Fri Nov 03, 2006 2:00 pm

Re: Win7: compiled wxWidgets 3.1.3, cannot build "minimal" sample.

Post by stahta01 » Sat Mar 28, 2020 10:41 pm

PB wrote:
Sat Mar 28, 2020 9:00 pm
stahta01 wrote:
Sat Mar 28, 2020 8:54 pm
I would guess a corrupt or edited makefile.gcc or config.gcc is the cause of the posters problem.
But those are shared between the library and samples, and the library build just fine?

I did not see any c:\MinGW in the OP's setup (for some reason, he seems to have it installed in C:\SVILUPPO\MinGWGet) but I noticed TDM-GCC-64 in the PATH. MinGW preceding it in the PATH should prevent any issues, but just to be sure I would remove it from there.
His compiler has the path C:\mingw hard coded in it. If it exists the compiler will try to use it.

Each sample folder has an makefile.gcc in it. The error implies a problem inside the makefile.

Tim S.

Glitch
Earned a small fee
Earned a small fee
Posts: 13
Joined: Fri Mar 27, 2020 9:54 am

Re: Win7: compiled wxWidgets 3.1.3, cannot build "minimal" sample.

Post by Glitch » Mon Mar 30, 2020 4:06 pm

Thanks to all. I've cleaned everything (the MinGW get setup linked by PB, the old TDM one which i can't remember why it was there, etc.
The only gcc related files i have are in one android SDK folder (which is'nt in any path/variable) and in a MAME source folder but they're on another disk.
PB wrote:
Sat Mar 28, 2020 6:47 pm
I am not that familiar with MinGW but are you using the one intended to be used with GCC makefiles and not the one for configure (=MSYS)?
yup, the wiki and some post here says it can be done that way, seems futile to use it, to me... am i wrong?

Anyway, i've downloaded another version from https://sourceforge.net/projects/mingw/ ... gcc-6.3.0/, but just testing it
results in an error messagebox 'cauce libconv-2.dll is'nt installed.

So, pls, could you tell me what version of GCC should i download and unzip/install (i'd prefer just a zip), the one that you know is stable and complete and worthy, then i'd restart building the WXWidgets from there....

.... thanks.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4228
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Win7: compiled wxWidgets 3.1.3, cannot build "minimal" sample.

Post by ONEEYEMAN » Mon Mar 30, 2020 5:17 pm

Hi,
What version did you downloaded? Where from?
What exact error message did you receive?

Thank you.

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2463
Joined: Sun Jan 03, 2010 5:45 pm

Re: Win7: compiled wxWidgets 3.1.3, cannot build "minimal" sample.

Post by PB » Mon Mar 30, 2020 5:53 pm

Glitch wrote:
Mon Mar 30, 2020 4:06 pm
So, pls, could you tell me what version of GCC should i download and unzip/install (i'd prefer just a zip), the one that you know is stable and complete and worthy, then i'd restart building the WXWidgets from there....
As I wrote above, I was able to build the library and the minimal sample using the exact build parameters AND MinGW package you had, and so was stahta01. This makes make believe, as I also wrote above, that the issue is not with the build toolchain. I still find it odd that you were able to build the library, as that is usually the issue when there is a problem. Additonally, line 8 in miminal's makefile.gcc where make reports the problem is empty?

Make sure there is no MinGW folder in the root of any drive you have, unless it is MinGW you are using to build. I would also delete whole wxWidgets folder and download and unpack it again, just to be sure.

Anyway, the officially recommended GCC-based toolchain (and the only one official 3.1.3 binaries are provided for) is currently mingw-64, you can get it from https://sourceforge.net/projects/mingw-w64/files/ (the latest GCC version if offers there is only 8.1 though).

BTW, you can always check if there is one or more gcc.exe in the PATH using the where command in the command line, e.g.

Code: Select all

where gcc.exe
EDIT
FWIW, I also tried to build the minimal sample using the exact same build parameters as the OP when (1) deleting build.cfg and (2) making build.cfg empty. In both cases the build succeeded which makes me think it is not even used. Funnily enough, I could not find any reference to build.cfg from the minimal's sample makefile.gcc nor included build/msw/setup.gcc, the only mention was in the library makefile (build/msw/makefile.gcc).

EDIT2
Out of curiousity: Did you also, as I suggested, tried the default build?

Glitch
Earned a small fee
Earned a small fee
Posts: 13
Joined: Fri Mar 27, 2020 9:54 am

Re: Win7: compiled wxWidgets 3.1.3, cannot build "minimal" sample.

Post by Glitch » Mon Mar 30, 2020 10:35 pm

ONEEYEMAN wrote:
Mon Mar 30, 2020 5:17 pm
What version did you downloaded? Where from?
Glitch wrote:
Mon Mar 30, 2020 4:06 pm
i've downloaded another version from https://sourceforge.net/projects/mingw/ ... gcc-6.3.0/,
the specific file is https://sourceforge.net/projects/mingw/ ... z/download
ONEEYEMAN wrote:
Mon Mar 30, 2020 5:17 pm
What exact error message did you receive?
Glitch wrote:
Mon Mar 30, 2020 4:06 pm
an error messagebox 'cauce libconv-2.dll is'nt installed.
I can't explain it much better: i call "gcc -v" from the CMD command prompt and it appears a windows message box. I can't copy/paste the text from there, and anyway it will be in italian. The meaning, thou, is that gcc.exe can't run 'cause libconv-2.dll is'nt installed on my system.
I googled for it and seems that's an old dependency which should'nt exists... anyway i stopped asking to you all what should be the right version before wasting my time trying to make things run and your time trying to help me.
PB wrote:
Mon Mar 30, 2020 5:53 pm
Make sure there is no MinGW folder in the root of any drive you have, unless it is MinGW you are using to build. I would also delete whole wxWidgets folder and download and unpack it again, just to be sure.
Yes, that was what i was trying to say in my previous post, sorry for haven't been clear. No MinGW folders in any root, nore in the path variable.
I then deleted the lib_ folders but i have no problems deleting the WXWIN folder and unzip it again.
PB wrote:
Mon Mar 30, 2020 5:53 pm
Out of curiousity: Did you also, as I suggested, tried the default build?
yes, same (non)result. I did'nt mentioned it 'cause i was restarting from scratch anyway.

Tomorrow (is past midnight here, right now) i'll install the linked mingw and try again.

Post Reply