Getting c++0x working [message #1706552] |
Thu, 27 August 2015 11:48  |
Eclipse User |
|
|
|
Hey folks,
I was wondering if anyone else was having issues getting a makefile project to compile with the c++0x flag set.
I can use the flag successfully with g++ from the CLI but I can not get it to work using make with an eclipse generated makefile either from CLI or from within eclipse. So Mingw-w64 is supporting c++11 stuff, just not when you use a makefile.
I've tried all sorts of settings from all over stack overflow and these forums but with no joy at all.
Any help would be much appreciated.
EDIT:
To shed some more light on the issue, the error is:
error: 'unique_ptr' is not a member of 'std'
I am including <memory>, so std::unique_ptr should be there.
The command that the makefile outputs it's using to compile is:
g++ -std=c++0x -O2 -g -Wall -c -fmessage-length=0 -o "src\\Test\\Test.o" "..\\src\\Test\\Test.cpp"
I have followed the advice on other forums for Luna, I have set the dialect and added the experimental variable and combinations thereof, I have also tried using -std=c++11 and tried the __cplusplus flag too.
[Updated on: Thu, 27 August 2015 16:24] by Moderator
|
|
|
|
|
|
|
|
|
Re: Getting c++0x working [message #1706716 is a reply to message #1706688] |
Sat, 29 August 2015 00:56  |
Eclipse User |
|
|
|
This may seem trivial but copy the g++ command from the log and execute it from the command line. Does it work from there? If it doesn't then what is missing? If it does then the question becomes why it doesn't work when Eclipse executes it. I would then look at the differences in the process environment.
You said, "I can use the flag successfully with g++ from the CLI" but was it with an actual build command used by Eclipse or something else?
Here's a typical compile from one of my builds (note: not generated by Eclipse and I've added line breaks):
g++ -c -Wall -c -std=c++11 -g -O0
-I hdr -I /usr/include
-I /usr/include/c++/5.1.1
-I /usr/include/c++/5.1.1/backward
-I /usr/include/c++/5.1.1/x86_64-redhat-linux
-I /usr/lib/gcc/x86_64-redhat-linux/5.1.1/include
-I ~/proj/LOCALLIB/inc -I~/proj/RXLIBS/inc
-I ~/proj/PNL/cxcore/cxcore/include
-I ~/proj/PNL/high/include
-I ~/proj/PNL/c_pgmtk/include
-I ~/proj/PNL/c_pgmtk/src/include
src/NNBR.cpp -o obj/NNBR.o
I found it necessary to add the system includes for my compiles (italics) which may not be what you actually need. I'm using a Fedora distro.
|
|
|
Powered by
FUDForum. Page generated in 0.15264 seconds