I ran into a problem on OS X where a Clang I compiled myself couldn't find standard C++ includes (e.g., #include <iostream>
) that the system-provided Clang could find. Using -v
, I found that the system Clang was searching in:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1
which actually has those files. My own Clang was saying, even when I passed it the right -resource-dir
to point it at the toolchain:
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1"
because the paths are slightly (include
vs. lib
). The reason seems to be that Clang had a bug that placed those include files in the wrong directory, and this was shipped in XCode 5. This bug was fixed, so now Clang looks in the "right" place, which is unfortunately wrong for the buggy system toolchain (see Apple's sources with the bug in place).
The only real solution is to patch up your include paths.