I'm trying to set up precompiled headers in a large C++ project compiled with GCC 5.4.
There is a file "PrecompiledHeaders.h", which includes all the other relevant headers. I've added the compile flag -include PrecompiledHeaders.h
, but when compiling, the header is not found:
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
But I'm sure it exists, in the same directory as all other h
and cpp
files. What's more, manually adding #include "PrecompiledHeaders.h"
to the top of "NetworkGameState.cpp" does not produce an error.
What could go wrong?
This is a CMake, out-of-source build, by the way.