wxWidgets SVN (3.00) MinGW64 gcc version 4.8.1 - MSYS-1.0.18

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
Ishtar
Experienced Solver
Experienced Solver
Posts: 78
Joined: Mon May 20, 2013 6:33 pm

wxWidgets SVN (3.00) MinGW64 gcc version 4.8.1 - MSYS-1.0.18

Post by Ishtar »

Hello everyone

For the last few days I have been battling with a compiler problem which I cannot resolve.

I am trying to compile wxWidgets SVN using MinGW64 (gcc version 4.7.0 to 4.8.1) together with MSYS 1.0.18 however the compiler crashes with the message:

Code: Select all

cc1plus.exe has stopped working.
My ultimate aim is to link wxWidgets against external libtiff, libjpeg-turbo and libpng. I have successfully compiled the image libraries and wxWidgets configure script finds all libraries without problem.

However, when I type make (msys build) the source starts to compile until it gets to src/common/any.cpp at which point the compiler crashes with the above mentioned error message. The last few lines from the build console are as follows

Code: Select all

/home/wx/wxWidgets/lib/libwxscintilla-3.0-x86_64-w64-mingw32.a
/home/wx/wxWidgets/bk-make-pch ./.pch/wxprec_baselib/wx/wxprec.h.gch wx/wxprec.h x86_64-w64-mingw32-g++ -I./.pch/wxprec_
baselib -D__WXMSW__      -DWXBUILDING -I/home/wx/wxWidgets/src/tiff/libtiff -I./src/tiff/libtiff -I./src/jpeg -I./src/pn
g -I./src/zlib -I./src/regex -I./src/expat/lib -DwxUSE_GUI=0 -DwxUSE_BASE=1 -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privac
y -Woverloaded-virtual -D_FILE_OFFSET_BITS=64 -I/home/wx/wxWidgets/lib/wx/include/x86_64-w64-mingw32-msw-unicode-static-
3.0 -I./include -DWX_PRECOMP -g -O0 -fpermissive
/home/wx/wxWidgets/bk-deps x86_64-w64-mingw32-g++ -c -o baselib_any.o -I./.pch/wxprec_baselib -D__WXMSW__      -DWXBUILD
ING -I/home/wx/wxWidgets/src/tiff/libtiff -I./src/tiff/libtiff -I./src/jpeg -I./src/png -I./src/zlib -I./src/regex -I./s
rc/expat/lib -DwxUSE_GUI=0 -DwxUSE_BASE=1 -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -D_FILE_OFF
SET_BITS=64 -I/home/wx/wxWidgets/lib/wx/include/x86_64-w64-mingw32-msw-unicode-static-3.0 -I./include -DWX_PRECOMP -g -O
0 -fpermissive  ./src/common/any.cpp

make: *** [baselib_any.o] Error 1
I use the following setup in order to configure the source.

Code: Select all

$ ./configure --host=x86_64-w64-mingw32 --disable-shared --enable-debug --with-zlib=sys --with-libjpeg=sys --with-libtiff=sys --with-libpng=sys --enable-compat26 --enable-compat28 --without-subdirs
When the configure script finished I am presented with the following

Code: Select all

Configured wxWidgets 3.0.0 for `x86_64-w64-mingw32'

  Which GUI toolkit should wxWidgets use?                 msw
  Should wxWidgets be compiled into single library?       no
  Should wxWidgets be linked as a shared library?         no
  Should wxWidgets support Unicode?                       yes (using wchar_t)
  What level of wxWidgets compatibility should be enabled?
                                       wxWidgets 2.6      yes
                                       wxWidgets 2.8      yes
  Which libraries should wxWidgets use?
                                       STL                no
                                       jpeg               sys
                                       png                sys
                                       regex              builtin
                                       tiff               sys
                                       zlib               sys
                                       expat              builtin
                                       libmspack          no
                                       sdl                no

I have also tried compiling wx using the standard builtin libraries using the following configure script however I get exactly the same error.

Code: Select all

$ ./configure --host=x86_64-w64-mingw32 --disable-shared --enable-debug --with-zlib=builtin --with-libjpeg=builtin --with-libtiff=builtin --with-libpng=builtin --enable-compat26 --enable-compat28 --without-subdirs
It must be stated that I have tried different versions of MSYS and different compiler versions. I have tried gcc from 4.7.0 through to 4.8.1 all produce exactly the same error. MinGW has been reinstalled countless times.

Strangely, I successfully compiled wx using the above configure script (external image libraries) using gcc-4.5.0. It built beautifully. Sadly, gcc-4.5 is not good enough because I need to build 64bit libraries.

Anyway, this has become a long post so hope somebody can help me.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxWidgets SVN (3.00) MinGW64 gcc version 4.8.1 - MSYS-1.

Post by doublemax »

I don't use MingW, so i can only make a few remarks based on what I've read over time:

GCC version 4.7.2 and later made some changes in the windows header files that break wxWidgets compilation. (This is only based on other people's problem i've read about, so i'm not sure about this). tdm64-gcc-4.7.1 is known to work, i'd use that for further tests.

Do you really need wxWidgets 2.6 compatibility? This configuration option is probably not used often.

Have you tried a 32bit build (just for a test).

In general, for this kind of questions, the mailing list may be a better place to ask.
https://groups.google.com/forum/?hl=en& ... m/wx-users
http://www.wxwidgets.org/support/maillst2.htm#users
Use the source, Luke!
Ishtar
Experienced Solver
Experienced Solver
Posts: 78
Joined: Mon May 20, 2013 6:33 pm

Re: wxWidgets SVN (3.00) MinGW64 gcc version 4.8.1 - MSYS-1.

Post by Ishtar »

Thank you

The TDM compiler worked perfectly :)
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: wxWidgets SVN (3.00) MinGW64 gcc version 4.8.1 - MSYS-1.

Post by stahta01 »

doublemax wrote:I don't use MingW, so i can only make a few remarks based on what I've read over time:

GCC version 4.7.2 and later made some changes in the windows header files that break wxWidgets compilation. (This is only based on other people's problem i've read about, so i'm not sure about this). tdm64-gcc-4.7.1 is known to work, i'd use that for further tests.

Do you really need wxWidgets 2.6 compatibility? This configuration option is probably not used often.

Have you tried a 32bit build (just for a test).
Edit: The problem appears to be caused by the PCH (Precomplied Header) because if you do NOT use PCH the problem goes away.

FYI: tdm32-gcc-4.8.1 fails with this error (cc1plus.exe has stopped working) on wxWidgets trunk and wxWidgets 2.9.4.
NOTE: wxWidgets 2.9.3 and tdm32-gcc-4.8.1 does not seem to have this problem; but, I did NOT do a full build to confirm this.

Tim S.
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: wxWidgets SVN (3.00) MinGW64 gcc version 4.8.1 - MSYS-1.

Post by stahta01 »

I have traced a possible point where the crashing of cc1plus.exe to a wxWidgets trunk SVN # 70514.
(Testing done compiling a modified Code::Blocks project to try to reduce the number of headers used in the PCH.)

Likely trigger is change to "include/wx/generic/choicdgg.h"

You have to be using Precompiled header (wxprec.h or in my case sdk_precomp.h CB header that normally includes wxprec.h) to see the problem.

Headers that seem directly required to trigger problem are

"wx/msw/wrapcctl.h" and any one on the below headers

<wx/choicdlg.h>, <wx/filedlg.h>, <wx/slider.h>, or <wx/textdlg.h>.

The problem seemed worse when I replaced "wx/msw/wrapcctl.h" with "wx/msw/wrapshl.h" to test if it also caused a problem.

The problem tends to go away when I try to make a small test case.

I have decided; this bug is too complex for a C Programmer to figure out; so, I am stopping any further research on the cause.
It needs a C++ person with MinGW GCC knowledge to find the exact cause; I am think a Compiler Bug related to inline function signatures and PCH.

Tim S.
ollydbg23
Super wx Problem Solver
Super wx Problem Solver
Posts: 438
Joined: Fri Dec 12, 2008 10:31 am

Re: wxWidgets SVN (3.00) MinGW64 gcc version 4.8.1 - MSYS-1.

Post by ollydbg23 »

It looks like this is a bug related to under MinGW, see: Bug 56926 – Crash (without ICE) while compiling Boost.Math
Post Reply