Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Photon C++11, 14, 17...(-std=c++11 is useless)
Photon C++11, 14, 17... [message #1795469] Sun, 23 September 2018 19:57 Go to next message
Aubin Mahé is currently offline Aubin MahéFriend
Messages: 4
Registered: September 2018
Junior Member
I have made a Makefile projects with -std=c++11 added to gcc CXXFLAGS with success.

Program compiles and runs nicely.

Eclipse built-in parser doesn't understant C++11 features while I'm using these lines in Window>Preferences>C/C++>Build>Settings>CDT GCC Built-in Compiler Settings [ Shared ]

${COMMAND} ${FLAGS} -std=c++11 -E -P -v -dD "${INPUTS}" -D_GNU_SOURCE

A simple test : open the file <type_traits> and see at line 34 :

#if __cplusplus < 201103L <==== Mouse fly over the symbol show 199711L

Where are the settings to enable C++11?
Re: Photon C++11, 14, 17... [message #1795692 is a reply to message #1795469] Thu, 27 September 2018 00:29 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
You used it. The version of g++ that you have doesn't support it.
Or so it seems.

If this is a Makefile project then you are responsible for the makefile content.
Make sure your compiles have -std=c++11

https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html

Look at the actual compiler builtin values
Project --> Properties --> C/C++ General --> Preprocessor Include Paths, Macros etc. --> Entries --> GNU C++ --> CDT GCC Builtin Compiler Settings
Here it is in mine:
index.php/fa/33958/0/

Also:
$ g++ -std=c++11 -E -P -v -dD -xc++ /dev/null 2>&1 | grep cplusplus
returns:
#define __cplusplus 201103L

My version:
$ g++ --version
g++ (GCC) 8.1.1 20180712 (Red Hat 8.1.1-5)

GCC Standards support schedule
https://www.gnu.org/software/gcc/projects/cxx-status.html




[Updated on: Thu, 27 September 2018 06:47]

Report message to a moderator

Previous Topic:Hardware Debugging works in Command line. Fails in Eclipse
Next Topic:IDE customization and integration with IoT platform
Goto Forum:
  


Current Time: Sat Apr 27 02:37:59 GMT 2024

Powered by FUDForum. Page generated in 0.02853 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top