我是 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/