Compiling with C++14?

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
GeatMaster
In need of some credit
In need of some credit
Posts: 9
Joined: Tue Jan 31, 2017 6:54 pm

Compiling with C++14?

Post by GeatMaster »

I'm trying to build an application I've already tested on kubuntu on Windows 8.1, and I'm getting an error "wcsdup was not declared in this scope" according to this: viewtopic.php?t=32214 The problem is that I'm using 2 different C++ versions, my application uses C++14, and wxwidges uses gnu++11, so I did this:

Code: Select all

$ make -f C:/wxWidgets-3.0.2/build/msw/Makefile.gcc clean
$ C:/wxWidgets-3.0.2/configure
$ make SHELL=CMD.exe -j2 -f C:/wxWidgets-3.0.2/build/msw/Makefile.gcc SHARED=0 MONOLITHIC=0 UNICODE=1 BUILD=release CXXFLAGS="-fno-keep-inline-dllexport -std=c++14"
    if not exists ..\..\lib\gcc_lib\mswu mkdir ..\..\lib\gcc_lib\mswu
And that's all it outputs. It doesn't build at all. What do I do?
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: Compiling with C++14?

Post by PB »

Have you tried the last version of wxWidgets on GitHub? Assuming you are using vanilla MinGW, there has been a bunch of fixes for MinGW 5.3 issues recently:
https://github.com/wxWidgets/wxWidgets/ ... =%E2%9C%93

Not sure if they are/will be backported to 3.0 branch. Some of them were for C++11 mode but I reckon they apply to C++14 as well... BTW, the guy who is pretty much the main wxWidgets maintainer recommends to use TDM-GCC on Windows instead of MinGW: https://groups.google.com/d/msg/wx-user ... FhgsF_AgAJ

Either way, as you have noticed, wxWidgets on Windows officially (see docs/msw/install.txt) support only GNU C++ mode - see the link above for reasons.
GeatMaster
In need of some credit
In need of some credit
Posts: 9
Joined: Tue Jan 31, 2017 6:54 pm

Re: Compiling with C++14?

Post by GeatMaster »

Now it (wxWidgets library compile) is giving me:
ar: gcc_mswu\corelibvlbox.o: no such file or directory.
Also it wouldn't run at first because it was doing this:

Code: Select all

mkdir ../../lib/gcc_lib/mswu 
instead of this:

Code: Select all

mkdir -p ../../lib/gcc_lib/mswu/wx 
(I'm not too familiar with fixing configure files)

My own compile is showing that Wx macros are being inconsistent about wchar_t vs char.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: Compiling with C++14?

Post by PB »

Sorry, I have never used configure, I build wxWidgets with provided GCC makefiles. Nevertheless, as long as you follow the install instructions, it should work out of the box.

Perhaps you encountered the "randomly missing characters in paths" GCC bug - the file should be named "corelib_vlbox.o"? BTW, if you will report it as an issue, make sure you list: wxWidgets version; exact compiler toolchain used and its version; configure commands you used.
GeatMaster
In need of some credit
In need of some credit
Posts: 9
Joined: Tue Jan 31, 2017 6:54 pm

Re: Compiling with C++14?

Post by GeatMaster »

if I don't run the configure the wx-config script doesn't exist, so I'm not sure how you can use it without running the configure.

creating a symlink from corelib_vlbox.o to corelibvlbox.o let the wx library complie, but my program is still creating errors regarding char * vs wchar_t *.

Trying the 3.0.2 build again gets the same error, the wcsdup error seems to have been removed by switching from mingw-gcc to the other one
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: Compiling with C++14?

Post by PB »

As I wrote above, the issues with MinGW and wxWidgets have been fixed just recently, wxWidgets 3.02 have been released in 2014, so...

On MSW you can compile wxWidgets without configure with GCC plain makefiles under Windows command line interpreter (see the instructions in WXWIN\docs\msw\install.txt").

If building latest wxWidgets with TDM-GCC and configure while following the official install instructions does not work, perhaps you should file a ticket on wxTrac.
GeatMaster
In need of some credit
In need of some credit
Posts: 9
Joined: Tue Jan 31, 2017 6:54 pm

Re: Compiling with C++14?

Post by GeatMaster »

it was because I included openGL before wxWidgets in a header, for some reason.
Post Reply