wxWidgets compilation errors with gcc 5.3

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.
TSib
Earned a small fee
Earned a small fee
Posts: 24
Joined: Thu Jun 16, 2016 8:22 am

wxWidgets compilation errors with gcc 5.3

Postby TSib » Tue Jan 10, 2017 2:42 pm

Hi,
I am working on GUI project where I use wxWidgets in Eclipse CDT. Recently, I upgrade GCC to version 5.3.0. Then, when I compile wxWidgets 3.1.0 library, I've got some errors like that :

Code: Select all

g++ -c -o gcc_mswuddll\basedll_any.o -g -O0 -mthreads  -DHAVE_W32API_H -D__WXMSW
__       -D_UNICODE -I..\..\lib\gcc_dll\mswud -I..\..\include  -W -Wall -DWXBUIL
DING -I..\..\src\tiff\libtiff -I..\..\src\jpeg -I..\..\src\png -I..\..\src\zlib
-I..\..\src\regex -I..\..\src\expat\lib -DwxUSE_GUI=0 -DWXMAKINGDLL_BASE -DwxUSE
_BASE=1   -Wno-ctor-dtor-privacy   -MTgcc_mswuddll\basedll_any.o -MFgcc_mswuddll
\basedll_any.o.d -MD -MP ../../src/common/any.cpp
In file included from ..\..\include/wx/crt.h:19:0,
                 from ../../src/common/any.cpp:24:
..\..\include/wx/wxcrt.h: In function 'int wxStricmp(const char*, const char*)':

..\..\include/wx/wxcrt.h:324:47: error: '_stricmp' was not declared in this scop
e
 #define WX_STR_CALL(func, a1, a2)  func(a1, a2)
                                               ^
..\..\include/wx/wxcrt.h:338:18: note: in expansion of macro 'WX_STR_CALL'
         { return WX_STR_CALL(crtA, s1, s2); }                                 \

                  ^
..\..\include/wx/wxcrt.h:402:5: note: in expansion of macro 'WX_STR_FUNC_NO_INVE
RT'
     WX_STR_FUNC_NO_INVERT(int, name, crtA, crtW, forString)                   \

     ^
..\..\include/wx/wxcrt.h:459:1: note: in expansion of macro 'WX_STRCMP_FUNC'
 WX_STRCMP_FUNC(wxStricmp, wxCRT_StricmpA, wxCRT_StricmpW, wxStricmp_String)
 ^
..\..\include/wx/wxcrt.h: In function 'int wxStricmp(const char*, const wxScoped
CharBuffer&)':
..\..\include/wx/wxcrt.h:324:47: error: '_stricmp' was not declared in this scop
e


I compile the library with the folowing code

Code: Select all

mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 USE_OPENGL=1 USE_GDIPLUS=1 BUILD=release


How can I resolve these problems?

thanks,

best regards

ST

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

Re: wxWidgets compilation errors with gcc 5.3

Postby ONEEYEMAN » Tue Jan 10, 2017 3:07 pm

Hi,
What version of gcc you had previously?
Are you compiling for Windows or Linux?

Thank you.

TSib
Earned a small fee
Earned a small fee
Posts: 24
Joined: Thu Jun 16, 2016 8:22 am

Re: wxWidgets compilation errors with gcc 5.3

Postby TSib » Tue Jan 10, 2017 3:09 pm

Previously, I used GCC 4.9 and I am working on Windows

ST

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

Re: wxWidgets compilation errors with gcc 5.3

Postby doublemax » Tue Jan 10, 2017 4:10 pm

Add this at the end of the command:

Code: Select all

CXXFLAGS="-std=gnu++11 -fno-keep-inline-dllexport"
Use the source, Luke!

TSib
Earned a small fee
Earned a small fee
Posts: 24
Joined: Thu Jun 16, 2016 8:22 am

Re: wxWidgets compilation errors with gcc 5.3

Postby TSib » Tue Jan 10, 2017 4:33 pm

Hi Doublemax,
I've added the command line as you suggested like that

Code: Select all

mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 USE_OPENGL=1 USE_GDIPLUS=1 BUILD=release CXXFLAGS="-std=gnu++11 -fno-keep-inline-dllexport"


Unfortunately, I've got the same errors. It seems that the problem comes from the version of GCC since severals changes have been made in that version leading some previous functionality obselete. In this case how can I solve the problem since no wxwidgets recent release is avalaible?

best regards,

ST

PB
wxWorld Domination!
wxWorld Domination!
Posts: 1103
Joined: Sun Jan 03, 2010 5:45 pm

Re: wxWidgets compilation errors with gcc 5.3

Postby PB » Tue Jan 10, 2017 4:47 pm

I assume you searched the forum but I will ask anyway: is your problem different then described in the thread with this post: https://forums.wxwidgets.org/viewtopic.php?f=19&t=42870&p=174176#p174176 and have you tried to build the current GIT version?

TSib
Earned a small fee
Earned a small fee
Posts: 24
Joined: Thu Jun 16, 2016 8:22 am

Re: wxWidgets compilation errors with gcc 5.3

Postby TSib » Wed Jan 11, 2017 9:48 am

Hi PB,
I have similar issues. They figure out issues by modifying the file C:\wxWidgets-3.0.2\include\wx\wxcrtbase.h (i.e. by removing the following code

Code: Select all

wxDECL_FOR_STRICT_MINGW32(int, _stricmp, (const char*, const char*))
wxDECL_FOR_STRICT_MINGW32(int, _strnicmp, (const char*, const char*, size_t))

Is it correct ? Actually I don't want to modify any basic code of wxWidgets since that mean that some modification occur in the next version of GCC, I will be obliged to modify again de code.
In addition, what GIT version do you mean? wxWidgets or GCC ?

Thanks you

best regards,

ST

PB
wxWorld Domination!
wxWorld Domination!
Posts: 1103
Joined: Sun Jan 03, 2010 5:45 pm

Re: wxWidgets compilation errors with gcc 5.3

Postby PB » Wed Jan 11, 2017 11:05 am

TSib wrote:In addition, what GIT version do you mean? wxWidgets or GCC?

I meant wxWidgets where the issue may have been already fixed in the GIT head.

TSib
Earned a small fee
Earned a small fee
Posts: 24
Joined: Thu Jun 16, 2016 8:22 am

Re: wxWidgets compilation errors with gcc 5.3

Postby TSib » Wed Jan 11, 2017 11:09 am

Hi,
Actually these issues occured when I upgraded GCC using MinGW installation manager. Before, I used GCC 4.9.3 which was compatible with wxWidgets 3.1.0 (since I built wx. with that version) . So I think that to resolve these issues, I will donwload GCC 4.9.3 and then rebuild wxWidgets library.

best regards,

ST

TSib
Earned a small fee
Earned a small fee
Posts: 24
Joined: Thu Jun 16, 2016 8:22 am

Re: wxWidgets compilation errors with gcc 5.3

Postby TSib » Wed Jan 11, 2017 12:41 pm

How can I get a previous version of GCC (e.g 4.9.3) using MinGW installation manager ? Only GCC 5.3.0 is availble with that application.

ST

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

Re: wxWidgets compilation errors with gcc 5.3

Postby doublemax » Wed Jan 11, 2017 12:50 pm

Can't you uninstall it? If not, just delete it. AFAIK they put everything in one directory.
Use the source, Luke!

TSib
Earned a small fee
Earned a small fee
Posts: 24
Joined: Thu Jun 16, 2016 8:22 am

Re: wxWidgets compilation errors with gcc 5.3

Postby TSib » Wed Jan 11, 2017 1:54 pm

Unfortunately, I was not able to download the version 4.9.3 of GCC. Actually, I have no problem when I build Boost library with GCC 5.3.0. The problem occurs only with wxWidgets. :cry: What can I do ?

ST

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

Re: wxWidgets compilation errors with gcc 5.3

Postby doublemax » Wed Jan 11, 2017 2:11 pm

I know for sure that TDM-GCC 5.1.0-3 works, because i tested that recently:
http://tdm-gcc.tdragon.net/download
Use the source, Luke!

PB
wxWorld Domination!
wxWorld Domination!
Posts: 1103
Joined: Sun Jan 03, 2010 5:45 pm

Re: wxWidgets compilation errors with gcc 5.3

Postby PB » Thu Jan 12, 2017 12:26 pm

FWIW, I was able to build wxWidgets with GCC 5.3.0, as described here: http://trac.wxwidgets.org/ticket/17762#comment:7

PB
wxWorld Domination!
wxWorld Domination!
Posts: 1103
Joined: Sun Jan 03, 2010 5:45 pm

Re: wxWidgets compilation errors with gcc 5.3

Postby PB » Thu Jan 19, 2017 7:58 am

Just for the future reference, a bunch of MinGW/GCC 5.3 issues has been fixed between January 13th and 15th, at least in the master branch.


Return to “Compiler / Linking / IDE Related”

Who is online

Users browsing this forum: No registered users and 3 guests