Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » How to make Eclipse CDT Indexer find C++ standard includes from a different compiler
How to make Eclipse CDT Indexer find C++ standard includes from a different compiler [message #1751033] Tue, 03 January 2017 19:18 Go to next message
Jason Fritz is currently offline Jason FritzFriend
Messages: 5
Registered: November 2011
Junior Member
Hi everybody,

I am using Eclipse Mars on CentOS 6.7. I have installed the RedHat devtoolset-3 in order to get an updated GCC compiler (4.9.2). The system header files for this compiler are installed under /opt/rh/devtoolset-3/root/usr/include/c++/4.9.2

I am having trouble changing the Eclipse project settings to get the CDT indexer to index these system header files instead of the system default header files under /usr/include/c++/4.4.4.

I'm attaching pics of how I have attempted configuring the "Paths and Symbols" and "Preprocessor Include Paths" for my project. Even after making these changes and re-indexing, the indexer still insists on finding system header files (e.g. unordered_map) under /usr/include/c++/4.4.4

BTW, we have a proprietary build system so I build my project outside of Eclipse, therefore the Eclipse Scanner is not going to autodetect any settings.

Thanks for any help!
Jason Fritz
Re: How to make Eclipse CDT Indexer find C++ standard includes from a different compiler [message #1751036 is a reply to message #1751033] Tue, 03 January 2017 19:40 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
I am assuming that you now have two GCCs on your machine, the default one that uses /usr/include/c++/4.4.4 and the new one that uses /opt/rh/devtoolset-3/root/usr/include/c++/4.9.2.

If so, in the preprocessor includes setting, under the providers tab, try to change the "CDT GCC Built-in Compiler Settings" to use your specific GCC instead of the default one. e.g. change
${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"
to
/path/to/gcc ${FLAGS} -E -P -v -dD "${INPUTS}"


Alternatively, update the default GCC on your system before launching Eclipse.

Remember, if you have made changes since you created the project and launched Eclipse, it may be worth an exit of Eclipse and relaunch.
Re: How to make Eclipse CDT Indexer find C++ standard includes from a different compiler [message #1751037 is a reply to message #1751036] Tue, 03 January 2017 20:00 Go to previous messageGo to next message
Jason Fritz is currently offline Jason FritzFriend
Messages: 5
Registered: November 2011
Junior Member
Thanks Jonas! This is partially working. It is picking up the system header files from the correct path now.

However, it seems C++11 support is not enabled so it is still not finding definitions for e.g. std::shared_ptr.

Can you point me to the additional setting I need to change?

Thanks again,
Jason
Re: How to make Eclipse CDT Indexer find C++ standard includes from a different compiler [message #1751040 is a reply to message #1751037] Tue, 03 January 2017 20:21 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
You need to add the -std=c++0x (or whatever it is) to the same command line you just edited.

[Updated on: Tue, 03 January 2017 20:22]

Report message to a moderator

Re: How to make Eclipse CDT Indexer find C++ standard includes from a different compiler [message #1751042 is a reply to message #1751040] Tue, 03 January 2017 20:47 Go to previous message
Jason Fritz is currently offline Jason FritzFriend
Messages: 5
Registered: November 2011
Junior Member
Thanks! I had to both add -std=c++14 AND force rebuilding the index to get it to work (just changing the command alone did not automatically rebuild the entire index).

I really appreciate your help!
- Jason
Previous Topic:Testing of lpc2214 compling using Eclipse
Next Topic:Access Arduino Platform Libraries
Goto Forum:
  


Current Time: Fri Apr 26 12:39:48 GMT 2024

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

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

Back to the top