[cfe-dev] [3.5 Release] <cxxabi.h> not found by clang-3.5 rc1 with libc++

Larry Evans cppljevans at suddenlink.net
Thu Aug 7 09:01:43 PDT 2014


On 08/05/2014 05:23 AM, Ben Pope wrote:
> On 08/04/2014 04:58 PM, Dan Albert wrote:
>>     ben:~/development/test$ clang++-3.5 -std=c++11 -stdlib=libc++ abi.cpp
>>     -nostdinc -I/usr/include/c++/v1
>>     In file included from abi.cpp:1:
>>     /usr/include/c++/v1/cxxabi.h:__18:10: fatal error: 'stddef.h' file
>>     not found
>>
>>
>> -nostdinc*++*. We still want it to find the standard headers, just not
>> libstdc++.
> 
> Mea culpa, it compiles successfully.
> 
>> LLVM_ENABLE_LIBCXX controls whether or not LLVM itself is built with
>> libc++. AFAIK, it shouldn't affect clang's behavior from the user side
>> of things.
>>
>> Sounds like it's an issue with clang's default include search path.
>> Maybe one of the clang people can chime in?
> 
> Is there some way to check what the include paths are?
> 
> Ben
Using -v flag shows these paths (as well as a bunch of other stuff).
Here's what I get:

make headers
/home/evansl/dwnlds/llvm/3.5rc1/build-variants/release/install/bin/clang++
-c -O0 -gdwarf-2 -std=c++1y   -isystem /usr/local/include/c++/4.9.0
-isystem /usr/local/include/c++/v1 -v -x c++ /dev/null -fsyntax-only
clang version 3.5.0 (tags/RELEASE_35/rc1)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Selected multilib: .;@m64
 "/home/evansl/dwnlds/llvm/3.5rc1/build-variants/release/install/bin/clang" -cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only -disable-free -main-file-name null -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -target-linker-version 2.24 -v -gdwarf-2 -dwarf-column-info -resource-dir /home/evansl/dwnlds/llvm/3.5rc1/build-variants/release/install/bin/../lib/clang/3.5.0 -isystem /usr/local/include/c++/4.9.0 -isystem /usr/local/include/c++/v1 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/x86_64-linux-gnu -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/backward -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8 -internal-isystem /usr/local/include -internal-isystem /home/evansl/dwnlds/llvm/3.5rc!
 1/build-va
riants/release/install/bin/../lib/clang/3.5.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O0 -std=c++1y -fdeprecated-macro -fdebug-compilation-dir /home/evansl/prog_dev/clang -ferror-limit 19 -fmessage-length 124 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -x c++ /dev/null
clang -cc1 version 3.5.0 based upon LLVM 3.5.0svn default target
x86_64-unknown-linux-gnu
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/x86_64-linux-gnu"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/c++/4.9.0
 /usr/local/include/c++/v1
 /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8
 /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/backward
 /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8
 /usr/local/include
 /home/evansl/dwnlds/llvm/3.5rc1/build-variants/release/install/bin/../lib/clang/3.5.0/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.

Compilation finished at Thu Aug  7 10:49:31


You'll have to parse the output to get the include paths shown between:

#include <...> search starts here:

and:

End of search list.

You may be curious about the /usr/local/include entries.  If you look at
the command, you'll see 2 -isystem flags.  I've had to add those to get
the compiles to work on a simple hello_work.cpp program.

HTH.

-regards,
Larry





More information about the cfe-dev mailing list