c++ - 从 Eclipse 自动生成的依赖项中排除文件夹?

标签 c++ eclipse makefile

我是 eclipse 的新手,经过 40 分钟的搜索仍无法解决这个问题。

我在最新版本的eclipse 中有一个c++ 项目。我的项目使用了 boost。

Eclipse 为我生成了一个 makefile,其中包含一堆列出依赖项的 .d 文件。 .d 文件中包含一长串 boost header 。

当我运行 make 时,它​​会扫描每一个 boost header 以查看它们是否已更改。这使得构建速度慢得无法忍受。

如何防止将 boost 文件夹中的任何内容添加到 .d 文件中?

非常感谢。

最佳答案

我通过转到项目 -> 属性 -> C/C++ 构建 -> 设置 -> Cross G++ 编译器 -> 杂项解决了这个问题,并在“其他标志”的末尾添加了“-isystem C:/路径/到/提升”。这指示 g++ 编译器将 -IC:/path/to/boost 添加的包含路径视为系统 header ,以便 -MD 依赖项生成标志(由 eclipse 使用)将忽略该目录。见

https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#index-isystem-1165

https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#index-MMD-1148

关于c++ - 从 Eclipse 自动生成的依赖项中排除文件夹?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29435047/

相关文章:

python - pydev安装后找不到python库

makefile - Makefile中@符号的含义? (不是回声抑制,也不是自动变量)

c++ - Visual C++不遵守堆栈变量的对齐方式

c++ - MSVC 2008 Express Edition 编译器做什么和不做什么

c++ - 在没有互斥锁的情况下并发追加到列表尾部

c++ - c++中iostream header 的cout,cerr,clog有什么区别?什么时候用哪一个?

eclipse中找不到java源代码

java - 全局 MediaPlayer 声明不起作用

makefile - 如何在make中分割字符串?

android - 适用于 Android 2.2 的动态 C/C++ 库 : error Symbol not found