Clang include paths
I'm running a fresh install of debian-testing on an amd64 laptop. I do
lots of C++ compiling, and prefer clang's error messages to g++'s
cryptic gobbledygook. After installing clang, I was surprised to find
that nothing compiled. Stepping back, I tried to compile hello world:
$ clang++ test.cpp
test.cpp:1:10: fatal error: 'iostream' file not found
#include <iostream>
^
1 diagnostic generated.
I checked that headers were installed (they were). However, specifying
include directories on the command line worked:
$ clang++ -I/usr/include/c++/4.5.2
-I/usr/include/c++/4.5.2/x86_64-linux-gnu test.cpp
compiles as expected.
According to the documentation, the include path is hard coded in a
source file, and the only way to *not* have to specify the full include
path on the command line is to compile from source.
My question is, is this a bug? If so, would it be fixed at the package
level or upstream? In the meantime, I can compile the compiler from
source. Also, why don't compilers have files like /etc/clang.conf that
allow you to set include paths more flexibly?
Thanks
--------
rbmj
Reply to: