Macos OSX clang`/usr/local/include`未包含搜索目录
我试图编译一些代码,但它似乎找不到头文件,因为Macos OSX clang`/usr/local/include`未包含搜索目录,macos,clang,header-files,macos-sierra,Macos,Clang,Header Files,Macos Sierra,我试图编译一些代码,但它似乎找不到头文件,因为/usr/local/lib目录未包含在clang搜索路径中 $ echo | clang -v -E -x c++ -stdlib=libc++ - Apple LLVM version 8.0.0 (clang-800.0.42.1) Target: x86_64-apple-darwin16.3.0 Thread model: posix ... <SNIP> ... #include "..." search starts he
/usr/local/lib
目录未包含在clang
搜索路径中
$ echo | clang -v -E -x c++ -stdlib=libc++ -
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.3.0
Thread model: posix
... <SNIP> ...
#include "..." search starts here:
#include <...> search starts here:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks (framework directory)
End of search list.
<代码> $CHORAN-VLA-V-E-XC++(STDLIB=LBB++)
苹果LLVM 8.0.0版(clang-800.0.42.1)
目标:x86_64-apple-darwin16.3.0
线程模型:posix
... ...
#包括“…”搜索从这里开始:
#包括搜索从这里开始:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/./include/c++/v1
/Applications/Xcode.app/Contents/Developer/toolschains/XcodeDefault.xctoolschain/usr/bin/./lib/clang/8.0.0/include
/Applications/Xcode.app/Contents/Developer/toolschains/xcodefault.xctoolschain/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks(框架目录)
搜索列表结束。
如您所见,
/usr/include
和/user/local/include
都不存在。我是否可以在某个地方更改配置以包含这些目录 对于简单的修复,请使用-I/usr/local/include-I/usr/include
编译器标志。但是/usr/include
应该是默认值;我不知道苹果为什么会这样做。是的,我的ld
搜索路径似乎也被搞砸了。。。有没有办法查找ld
的搜索路径?我不知道有类似的ld
命令。Fwiw,我在El Capitan上,有完全相同的版本,我确实看到了/usr/include
和/usr/local/include
。答案有帮助吗?