cannot compile wxWidgets in windows with MingW

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.
walker
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Jan 03, 2018 2:10 am

cannot compile wxWidgets in windows with MingW

Postby walker » Thu Jan 04, 2018 2:06 am

I installed MingW, have correct PATH and git the source code.

WXWIN=c:\wxWidgets
MINGW=c:\mingw\bin

PATH has those
c:\mingw;c:\mingw\bin;c:\mingw\mingw64\bin;C:\mingw\libexec\gcc\mingw32\4.8.1

I use those steps in this site:
https://wiki.wxwidgets.org/Compiling_wx ... with_MinGW
My wxWidgets is the trunk (use git to pull down the source code)

version:
mingw32-make --version
GNU Make 3.82.90
Built for i686-pc-mingw32
Copyright (C) 1988-2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

I use this to compile:
mingw32-make SHELL=CMD.exe -f makefile.gcc BUILD=release UNICODE=1 SHARED=0 MONOLITHIC=1 CXXFLAGS="-fno-keep-inline-dllexport -std=gnu++11"

The Error message is:
ar: gcc_mswu\monlib_framecmn.o: No such file or directory
makefile.gcc:5219: recipe for target '..\..\lib\gcc_lib\libwxmsw31u.a' failed
mingw32-make: *** [..\..\lib\gcc_lib\libwxmsw31u.a] Error 1

Thanks

catalin
Moderator
Moderator
Posts: 1418
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: cannot compile wxWidgets in windows with MingW

Postby catalin » Thu Jan 04, 2018 6:29 am

That should be fine, unless there is a bug with that configuration. Try without MONOLITHIC=1, since that doesn't matter anyway with static libs.

walker
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Jan 03, 2018 2:10 am

Re: cannot compile wxWidgets in windows with MingW

Postby walker » Thu Jan 04, 2018 7:15 am

Thanks
But I feel not comfortable of the error message.
It seems something of MinGW make utility cannot handle huge array of strings. In makefile.gcc I shorten some names string such as
"monolib" to "mnlib",
"monodll" to "mndll",
"basedll" to "bsdll",
"baselib" to "bslib"
"webviewdll" to "wbdll"
...
and it starts to compile. But I got new error:
c:\mingw\include\stdio.h:345:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__mingw__snprintf'
extern int __mingw_stdio_redirect__(snprintf)(char*, size_t, const char*, ...); error come out:

I do not know what to do.

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

Re: cannot compile wxWidgets in windows with MingW

Postby PB » Thu Jan 04, 2018 8:24 am

walker wrote:and it starts to compile. But I got new error:
c:\mingw\include\stdio.h:345:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__mingw__snprintf'
extern int __mingw_stdio_redirect__(snprintf)(char*, size_t, const char*, ...); error come out:


This is odd as this issue has been fixed in the trunk about a month ago: https://github.com/wxWidgets/wxWidgets/commit/879876e047d9aabe4b144944449a5ffe5a37ffed, although the issue manifested only with MinGW32 distribution using GCC 6.

As for the known issue of missing letters in paths, have you tried to build without using the shell parameter?

BTW, AFAIK the "-fno-keep-inline-dllexport" parameter is of no use for static builds.
Last edited by PB on Thu Jan 04, 2018 9:02 am, edited 1 time in total.

User avatar
doublemax
Moderator
Moderator
Posts: 12318
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: cannot compile wxWidgets in windows with MingW

Postby doublemax » Thu Jan 04, 2018 9:00 am

The real reason for the missing characters is still a mystery, but it's related to the MONOLITHIC option:
https://wiki.wxwidgets.org/Compiling_wx ... HIC_option

Instead of the workaround in the wiki article, i'd suggest to not use MONOLITHIC.
Use the source, Luke!

User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: cannot compile wxWidgets in windows with MingW

Postby eranon » Thu Jan 04, 2018 1:21 pm

Not related to your error, but you don't need all of these MinGW related stuff in your path: "C:\<path-to-your-mingw>\bin" should be enough.
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]

stahta01
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 219
Joined: Fri Nov 03, 2006 2:00 pm

Re: cannot compile wxWidgets in windows with MingW

Postby stahta01 » Sun Jan 14, 2018 1:10 am

eranon wrote:Not related to your error, but you don't need all of these MinGW related stuff in your path: "C:\<path-to-your-mingw>\bin" should be enough.


You are wrong; if he did your fix then the "SHELL=CMD.exe" would not be needed.
And, the problem would likely go away.

I use monolithic all the time; and, I only have issues when I also use "SHELL=CMD.exe".

Tim S.

User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: cannot compile wxWidgets in windows with MingW

Postby eranon » Sun Jan 14, 2018 3:07 am

stahta01 wrote:You are wrong; if he did your fix then the "SHELL=CMD.exe" would not be needed.

What fix? I don't give any fix here. I just say that his PATH was overcrowded.
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]

stahta01
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 219
Joined: Fri Nov 03, 2006 2:00 pm

Re: cannot compile wxWidgets in windows with MingW

Postby stahta01 » Sun Jan 14, 2018 1:32 pm

eranon wrote:
stahta01 wrote:You are wrong; if he did your fix then the "SHELL=CMD.exe" would not be needed.

What fix? I don't give any fix here. I just say that his PATH was overcrowded.


The reason for adding "SHELL=CMD.exe" is because the PATH has sh.exe in it.
If you change the path to only the MinGW Compiler; you no longer need "SHELL=CMD.exe".

Tim S.

User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: cannot compile wxWidgets in windows with MingW

Postby eranon » Sun Jan 14, 2018 2:04 pm

I agree (even if it depends on your build environment; I'm used to go from native Windows one about wxWidgets -- w/o msys, msys2 or cygwin), Tim, but I didn't extrapolate to the content of its overall PATH content (he didn't show his overall PATH). I only talked about the part about MinGW (where he said he added "c:\mingw;c:\mingw\bin;c:\mingw\mingw64\bin;C:\mingw\libexec\gcc\mingw32\4.8.1").
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]


Return to “Compiler / Linking / IDE Related”

Who is online

Users browsing this forum: No registered users and 5 guests