Win10, built Widgets, cannot make Minimal Topic is solved

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
User avatar
Parduz
I live to help wx-kind
I live to help wx-kind
Posts: 150
Joined: Fri Jan 30, 2015 1:48 pm
Location: Bologna, Italy

Win10, built Widgets, cannot make Minimal

Post by Parduz »

I am SO afraid to ask this again, i was thinking i were starting to know wxWidgets better than this.
Also searched the forum for the error, but i did'nt found useful solutions)



On a fresh Windows 10 PC, i am following this guide with some of my past experience put in the mix.
  1. I've unzipped the windows sources in C:\_SVILUPPO_\_TOOLCHAINS_\wxWidgets-3.1.7-win, which is set as the value of the WXWIN environment variable.
  2. from the %WXWIN%\build\msw folder, i've opened a CMD session, and fired this previously made batch file:

    Code: Select all

    set PATH=C:\_SVILUPPO_\_TOOLCHAINS_\mingw64-10.3.0\bin;%PATH%
    set Comp_Version=_MinGW1030x64_r
    mingw32-make -j8 -f makefile.gcc setup_h CXXFLAGS=-std=gnu++17 USE_XRC=1 SHARED=0 UNICODE=1 MONOLITHIC=0 BUILD=release CFG=%Comp_Version%
    mingw32-make -j8 -f makefile.gcc CXXFLAGS=-std=gnu++17 USE_XRC=1 SHARED=0 UNICODE=1 MONOLITHIC=0 BUILD=release CFG=%Comp_Version%
    
    The wxWidgets were successfully built in %WXWIN%\lib\gcc_lib_MinGW1030x64_r
  3. As the linked guide says, switched to %WXWIN%\samples\minimal and launched mingw32-make minimal which produced this output:

    Code: Select all

    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.
    mingw32-make: *** [<builtin>: minimal] Error 1
    
I tried to add %WXWIN%\include to the %PATH% but it does'nt change (as expected, as the makefile.gcc put

Code: Select all

-I.\..\..\include \
in the parameters).

So, what have i not done?
User avatar
[email protected]
Super wx Problem Solver
Super wx Problem Solver
Posts: 267
Joined: Wed Jul 29, 2020 6:06 pm

Re: Win10, built Widgets, cannot make Minimal

Post by [email protected] »

From the page you quoted:
To verify your build, change the directory to samples\minimal and run the same mingw32-make command (with the same parameters there), this should create a working minimal wxWidgets sample.
Call mingw32-make with the same parameters you used for building the wx libs.
User avatar
Parduz
I live to help wx-kind
I live to help wx-kind
Posts: 150
Joined: Fri Jan 30, 2015 1:48 pm
Location: Bologna, Italy

Re: Win10, built Widgets, cannot make Minimal

Post by Parduz »

[email protected] wrote: Wed Nov 23, 2022 9:54 am From the page you quoted:
To verify your build, change the directory to samples\minimal and run the same mingw32-make command (with the same parameters there), this should create a working minimal wxWidgets sample.
Call mingw32-make with the same parameters you used for building the wx libs.
Doh!
I said i was ashamed to ask.



BUT
i'm still failing.

Code: Select all

C:\_SVILUPPO_\_TOOLCHAINS_\wxWidgets-3.1.7-win\samples\minimal>path
PATH=C:\_SVILUPPO_\_TOOLCHAINS_\mingw64-10.3.0\bin;C:\Python310\Scripts\;C:\Python310\;C:\Windows\Microsoft.NET\Framework\v1.1.4322\;C:\_SVILUPPO_\BDS2006\Borland\BDS\4.0\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Borland\Components\TMS Component Pack\bpl\;C:\_SVILUPPO_\BDS2006\Borland\Componenti\TMSComponentPack\bpl\;C:\Program Files\Inkscape\bin;C:\Program Files\PuTTY\;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\tools\lxrunoffline;C:\Users\Parduz\Documents\Borland Studio Projects\Bpl;C:\Source\__compiler_out__\_bpl_lib;C:\Users\Parduz\AppData\Local\Microsoft\WindowsApps;C:\Users\Parduz\AppData\Roaming\npm;C:\_SVILUPPO_\_TOOLCHAINS_\wxWidgets-3.1.7-win

C:\_SVILUPPO_\_TOOLCHAINS_\wxWidgets-3.1.7-win\samples\minimal>echo %WXWIN%
"C:\_SVILUPPO_\_TOOLCHAINS_\wxWidgets-3.1.7-win"

C:\_SVILUPPO_\_TOOLCHAINS_\wxWidgets-3.1.7-win\samples\minimal>mingw32-make minimal CXXFLAGS=-std=gnu++17 USE_XRC=1 SHARED=0 UNICODE=1 MONOLITHIC=0 BUILD=release CFG=_MinGW1030x64_r
g++ -std=gnu++17    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.
mingw32-make: *** [<builtin>: minimal] Error 1

C:\_SVILUPPO_\_TOOLCHAINS_\wxWidgets-3.1.7-win\samples\minimal>

This is the content of the %WXWIN%\lib\gcc_lib_MinGW1030x64_r\mswu\Build.cfg file:

Code: Select all

WXVER_MAJOR=3 
WXVER_MINOR=1 
WXVER_RELEASE=7 
BUILD=release 
MONOLITHIC=0 
SHARED=0 
UNICODE=1 
TOOLKIT=MSW 
TOOLKIT_VERSION= 
WXUNIV=0 
CFG=_MinGW1030x64_r 
VENDOR=custom 
OFFICIAL_BUILD=0 
DEBUG_FLAG=1 
DEBUG_INFO=default 
RUNTIME_LIBS=dynamic 
USE_EXCEPTIONS=1 
USE_RTTI=1 
USE_THREADS=1 
USE_AUI=1 
USE_GUI=1 
USE_HTML=1 
USE_MEDIA=1 
USE_OPENGL=1 
USE_QA=0 
USE_PROPGRID=1 
USE_RIBBON=1 
USE_RICHTEXT=1 
USE_STC=1 
USE_WEBVIEW=1 
USE_XML=1 
USE_XRC=1 
COMPILER=gcc 
COMPILER_VERSION= 
CC=gcc 
CXX=g++ 
CFLAGS= 
CPPFLAGS= 
CXXFLAGS=-std=gnu++17 
LDFLAGS= 
User avatar
doublemax
Moderator
Moderator
Posts: 17820
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Win10, built Widgets, cannot make Minimal

Post by doublemax »

The "-f makefile.gcc" part is missing. And you don't need the "minimal".

Try this:

Code: Select all

mingw32-make -f makefile CXXFLAGS=-std=gnu++17 USE_XRC=1 SHARED=0 UNICODE=1 MONOLITHIC=0 BUILD=release CFG=_MinGW1030x64_r
Use the source, Luke!
User avatar
Parduz
I live to help wx-kind
I live to help wx-kind
Posts: 150
Joined: Fri Jan 30, 2015 1:48 pm
Location: Bologna, Italy

Re: Win10, built Widgets, cannot make Minimal

Post by Parduz »

doublemax wrote: Wed Nov 23, 2022 5:10 pm The "-f makefile.gcc" part is missing. And you don't need the "minimal".
Right. "-f makefile.gcc" compiled!
Thanks

Out of couriosity, what makefile was executed with my wrong line?
PB
Part Of The Furniture
Part Of The Furniture
Posts: 3696
Joined: Sun Jan 03, 2010 5:45 pm

Re: Win10, built Widgets, cannot make Minimal

Post by PB »

Parduz wrote: Thu Nov 24, 2022 8:29 am Out of couriosity, what makefile was executed with my wrong line?
When you do not pass a makefile to GNU make (with -f), make has a set of rules what to do in this case. You can display the rules with adding "-d" to the command line.

In your case, it ended attempting to compile a file your passed it, i.e., minimal.cpp, as you can see in the make output you pasted in the OP.
User avatar
Parduz
I live to help wx-kind
I live to help wx-kind
Posts: 150
Joined: Fri Jan 30, 2015 1:48 pm
Location: Bologna, Italy

Re: Win10, built Widgets, cannot make Minimal

Post by Parduz »

PB wrote: Thu Nov 24, 2022 9:00 am In your case, it ended attempting to compile a file your passed it, i.e., minimal.cpp, as you can see in the make output you pasted in the OP.
Thanks.
I thought it had found a rule in one of the makefile.*, not that it was .... how can i say .... autonomously compiling it.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 6420
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Win10, built Widgets, cannot make Minimal

Post by ONEEYEMAN »

Hi,
Unfortunately, (or fortunately 😕 ) the computers are not (yet?) that smart.
Terminators is still a fiction.

Thank you.
Post Reply