Linux Eclipse CDT 内置包含目录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9864003/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 05:23:33  来源:igfitidea点击:

Eclipse CDT Builtin Include Directories

c++linuxeclipsegcceclipse-cdt

提问by Andrew Tomazos

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.

Eclipse 启动时会自动重新扫描路径。

I have gcc 4.6 and gcc 4.7 installed side-by-side.

我并排安装了 gcc 4.6 和 gcc 4.7。

When Eclipse rescans it only finds the 4.6 headers and not the 4.7 ones.

当 Eclipse 重新扫描时,它只找到 4.6 标头,而不是 4.7 标头。

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

我的问题是:Eclipse 通过什么机制确定内置包含路径的列表?(因此为什么它只找到 4.6 标头而不是 4.7 标头?)

采纳答案by Sean

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.

这由 Project->Properties->C/C++ Build->Discovery Options 上的设置控制。默认情况下,Eclipse 将调用 g++ 来发现包含目录。路径上的第一个 g++ 实例将被调用。您始终可以设置要用于项目的编译器的完整路径。