vivek pandya via llvm-dev
2016-Jun-23 13:31 UTC
[llvm-dev] clang++ build from source is not able to find C++ headers
Hello, I am running OS X, when I build clang++ from source and use it to compile .cpp files it fails as it is not able to find C++ header. I am not building libc++ along with llvm and clang. using -stdlib=libstdc++ solves problem partially but it fails when using C++11 threads, again it can't find <thread>, to get this work clang++ should work with -stdlib=libc++ but it fails with previous error of not finding C++ headers. Is it required to build libc++ along with clang++? clang++ with Xcode-command line tool works fine and it also work with -stdlib=libc++. How to solve this problem with my build clang++? Sincerely, Vivek -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160623/e1d8d047/attachment.html>
Tim Northover via llvm-dev
2016-Jun-23 14:06 UTC
[llvm-dev] [cfe-dev] clang++ build from source is not able to find C++ headers
On 23 June 2016 at 06:31, vivek pandya via cfe-dev <cfe-dev at lists.llvm.org> wrote:> I am running OS X, when I build clang++ from source and use it to compile > .cpp files it fails as it is not able to find C++ header. I am not building > libc++ along with llvm and clang.When I'm not building with libcxx in-tree I find it easiest to just symlink Xcode's libc++ headers into the build directory. Something like "ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++ build/include".> using -stdlib=libstdc++ solves problem partially but it fails when using > C++11 threads, again it can't find <thread>, to get this work clang++ should > work with -stdlib=libc++ but it fails with previous error of not finding C++ > headers.Yes, the libstdc++ included with OS X is ancient (from GCC 4.2 I think) and there only for compatibility reasons. It has virtually no support for C++11, which LLVM needs. Cheers. Tim.
vivek pandya via llvm-dev
2016-Jun-23 17:56 UTC
[llvm-dev] [cfe-dev] clang++ build from source is not able to find C++ headers
On Thu, Jun 23, 2016 at 7:36 PM, Tim Northover <t.p.northover at gmail.com> wrote:> On 23 June 2016 at 06:31, vivek pandya via cfe-dev > <cfe-dev at lists.llvm.org> wrote: > > I am running OS X, when I build clang++ from source and use it to compile > > .cpp files it fails as it is not able to find C++ header. I am not > building > > libc++ along with llvm and clang. > > When I'm not building with libcxx in-tree I find it easiest to just > symlink Xcode's libc++ headers into the build directory. Something > like "ln -s > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++ > build/include". >Thanks Tim, symlink to build include does not help because clang++ looks headers into build/lib/clang/3.9.0/include ( as per output of clang++ -v) but I symlink to /usr/local/include , that worked I hope there is nothing wrong in doing so. -Vivek> > > using -stdlib=libstdc++ solves problem partially but it fails when using > > C++11 threads, again it can't find <thread>, to get this work clang++ > should > > work with -stdlib=libc++ but it fails with previous error of not finding > C++ > > headers. > > Yes, the libstdc++ included with OS X is ancient (from GCC 4.2 I > think) and there only for compatibility reasons. It has virtually no > support for C++11, which LLVM needs. > > Cheers. > > Tim. >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160623/70cdee0a/attachment.html>
Reasonably Related Threads
- [cfe-dev] clang++ build from source is not able to find C++ headers
- [cfe-dev] clang++ build from source is not able to find C++ headers
- [cfe-dev] clang++ build from source is not able to find C++ headers
- [LLVMdev] How to run LLVM3.6.1 on OS X (Yosemite, Xcode6.4) OR how to link bitcode generated by OS X clang with LLVM3.6.1
- Clang includes search path