我正在使用clang编译我的项目,但我遇到了一个奇怪的错误:
[ 1%] Building CXX object CMakeFiles/tfs.dir/src/actions.cpp.o
In file included from /home/travis/build/dominique120/miniature-adventure/src/actions.cpp:20:
In file included from /home/travis/build/dominique120/miniature-adventure/src/otpch.h:27:
/home/travis/build/dominique120/miniature-adventure/src/definitions.h:39:10: fatal error:
'cmath' file not found
#include <cmath>
^
make: *** [all] Error 2我的actions.cpp第20行:
#include "otpch.h"otpch.h第27行:
#include "definitions.h"Finitions.h第31行:
#include <cmath>我做了一些编辑,但是我不知道是什么导致了这个错误,在这里编辑:https://github.com/dominique120/miniature-adventure/commits/master
注: GCC只是抛出了一大堆错误:https://travis-ci.org/dominique120/miniature-adventure/jobs/21905513
发布于 2014-12-23 06:19:19
在谷歌上搜索了我在macOS上遇到的一个问题后,我来到了你的帖子。我正在分享一个解决方案,尽管它只适用于Mac用户。
很有可能您升级了Xcode (或者它是为您升级的),并且继续使用旧的编译方案。
确定磁盘上实际存在以下哪些目录:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/并确保在您的编译开关中有-I和一个存在的目录。
https://stackoverflow.com/questions/22752000
复制相似问题