Under
Eclipse CDT >
Project Settings >
C/C++ General >
Paths and Symbols >
Includes >
GNU C++
There is a list of include paths.
Some are in bold and are project specific.
Others are builtin:
For example:
/usr/include/C++/4.6/
/usr/include/x86_64-linux-gnu
etc
If I delete:
work/.metadata/.plugins/org.eclipse.cdt.make.core/*.sc
The paths are automatically rescanned when Eclipse launches.
I have gcc 4.6 and gcc 4.7 installed side-by-side.
When Eclipse rescans it only finds the 4.6 headers and not the 4.7 ones.
My question is this: By what mechanism does Eclipse determine the list of builtin include paths? (and hence why is it only finding the 4.6 headers and not the 4.7 headers?)
Built-in Settings. CDT will try to detect built-in compiler symbols and include paths running the compiler with special options and parse the output of this special run. Most compilers provide such an option to print built-in include paths and symbols.
Select C/C++ General -> Path and Symbols. Select Includes tab. In Languages list, select 'GNU C' or whatever C compiler tool chain you use. Press 'Add...' button and add the directory for the include files.
This is controlled by the settings on Project->Properties->C/C++ Build->Discovery Options. By default, Eclipse will call g++ to discover the include directories. The first instance of g++ on the path will be the one that gets invoked. You can always set the full path to the compiler you want it to use for your project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With