【发布时间】:2017-10-18 10:51:00
【问题描述】:
我正在尝试在使用 GCC 5.4 编译的大型 C++ 项目中设置预编译头文件。
有一个文件“PrecompiledHeaders.h”,其中包括所有其他相关的头文件。我已经添加了编译标志-include PrecompiledHeaders.h,但是编译的时候找不到头文件:
cc1plus: fatal error: PrecompiledHeaders.h: No such file or directory
compilation terminated.
CMakeFiles/Project.dir/build.make:62: recipe for target 'CMakeFiles/Project.dir/NetworkGameState.cpp.o' failed
但我确定它存在,与所有其他 h 和 cpp 文件位于同一目录中。更重要的是,手动将#include "PrecompiledHeaders.h" 添加到“NetworkGameState.cpp”的顶部不会产生错误。
会出什么问题?
顺便说一下,这是一个 CMake,源外构建。
【问题讨论】:
标签: c++ gcc include precompiled-headers