Closed taiya closed 10 years ago
Hi,
You just need to provide path to your STL library -isystem
Best regards,
Software Engineer Intel Compiler Team Intel Corp.
Thanks Alexey for your reply. I backtracked in a IDE what "iostream" the XCode clang was using, and now this compiles correctly:
/usr/local/bin/clang++ -isystem /Library/Developer/CommandLineTools/usr/lib/c++/v1 clang.cpp
Nonetheless, I do not find this a completely satisfactory solution. This is exactly why in my original question I was asking for the proper way of configuring this. Why the /usr/bin/clang does not need the aforementioned -isystem? Is there a way of telling clang where to look for these by default? I also looked at the "clang -print-search-dirs" but these do not seem to be relevant.
Basically I want to obtain an identical configuration to the one that ships with the XCode compiler.
/usr/bin/clang is clang built by Apple and it is preconfigured by Apple to know path to libc++ library. Clang built from trunk does not know about path to libc++. Before Xcode 5 libc++ was placed in standard /usr/include and clang was able to locate it. But since Xcode 5 it was changed and clang built from sources requires additional options.
Best regards,
Software Engineer Intel Compiler Team Intel Corp.
As I am compiling Clang myself is there a default way to pre-configure my custom clang build to know where to find the STL libraries? (I could even ship them with the compiler as apple does, except I'd place them in /usr/local/include)
You can call ayour clang with flag -v which shows standard paths where clang is trying to located some standard includes. You may place your libc++ in one of these directories. For example, clang tries to find include files in /usr/local/include, you can put them to this directory.
Best regards,
Software Engineer Intel Compiler Team Intel Corp.
Perfect, that's exactly what I was looking for.
For this simple STL helloworld:
Compiled "ok" with the default clang compiler:
But if I compile it with the clang-omp I get this error:
I know I am missing the STL library; but what's the proper way to proceed?