Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse CDT Builtin Include Directories

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?)

like image 695
Andrew Tomazos Avatar asked Mar 25 '12 20:03

Andrew Tomazos


People also ask

What is built in include path?

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.

HOW include header file in C Eclipse?

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.


1 Answers

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.

like image 182
Sean Avatar answered Oct 23 '22 17:10

Sean