История изменений
Исправление proud_anon, (текущая версия) :
Вот что происходит при компиляции хэллоуворлда:
$ clang++ -v --gcc-toolchain=/usr/lib/gcc/x86_64-linux-gnu/4.8 hello.cc
Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)
Target: x86_64-pc-linux-gnu
Thread model: posix
Selected GCC installation:
"/usr/bin/clang" -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name hello.cc -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version 2.24 -v -resource-dir /usr/bin/../lib/clang/3.4 -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/3.4/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir /home/fedor/test -ferror-limit 19 -fmessage-length 80 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o /tmp/hello-7a5cb0.o -x c++ hello.cc
clang -cc1 version 3.4 based upon LLVM 3.4 default target x86_64-pc-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/bin/../lib/clang/3.4/include
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
hello.cc:2:10: fatal error: 'iostream' file not found
#include <iostream>
^
1 error generated.
Может быть, я не ту директорию указываю в качестве gcc root? Вот что лежит в /usr/lib/gcc/x86_64-linux-gnu/4.8:
$ ls /usr/lib/gcc/x86_64-linux-gnu/4.8
32 include libgcov.a libobjc.so
cc1 include-fixed libgomp.a libquadmath.a
cc1plus libasan.a libgomp.so libquadmath.so
collect2 libasan_preinit.o libgomp.spec libssp_nonshared.a
crtbegin.o libasan.so libitm.a libstdc++.a
crtbeginS.o libatomic.a libitm.so libstdc++.so
crtbeginT.o libatomic.so libitm.spec libsupc++.a
crtend.o libbacktrace.a liblto_plugin.so libtsan.a
crtendS.o libgcc.a liblto_plugin.so.0 libtsan.so
crtfastmath.o libgcc_eh.a liblto_plugin.so.0.0.0 lto1
crtprec32.o libgcc_s_32.so libobjc.a lto-wrapper
crtprec64.o libgcc_s.so libobjc_gc.a x32
crtprec80.o libgcc_s_x32.so libobjc_gc.so
Исходная версия proud_anon, :
Я набрал следующее:
clang++ -v --gcc-toolchain=/usr/lib/gcc/x86_64-linux-gnu/4.8 hello.cc
Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)
Target: x86_64-pc-linux-gnu
Thread model: posix
Selected GCC installation:
"/usr/bin/clang" -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name hello.cc -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version 2.24 -v -resource-dir /usr/bin/../lib/clang/3.4 -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/3.4/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir /home/fedor/test -ferror-limit 19 -fmessage-length 80 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o /tmp/hello-7a5cb0.o -x c++ hello.cc
clang -cc1 version 3.4 based upon LLVM 3.4 default target x86_64-pc-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/bin/../lib/clang/3.4/include
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
hello.cc:2:10: fatal error: 'iostream' file not found
#include <iostream>
^
1 error generated.
Может быть, я не ту директорию указываю в качестве gcc root? Вот что лежит в /usr/lib/gcc/x86_64-linux-gnu/4.8:
$ls /usr/lib/gcc/x86_64-linux-gnu/4.8
32 include libgcov.a libobjc.so
cc1 include-fixed libgomp.a libquadmath.a
cc1plus libasan.a libgomp.so libquadmath.so
collect2 libasan_preinit.o libgomp.spec libssp_nonshared.a
crtbegin.o libasan.so libitm.a libstdc++.a
crtbeginS.o libatomic.a libitm.so libstdc++.so
crtbeginT.o libatomic.so libitm.spec libsupc++.a
crtend.o libbacktrace.a liblto_plugin.so libtsan.a
crtendS.o libgcc.a liblto_plugin.so.0 libtsan.so
crtfastmath.o libgcc_eh.a liblto_plugin.so.0.0.0 lto1
crtprec32.o libgcc_s_32.so libobjc.a lto-wrapper
crtprec64.o libgcc_s.so libobjc_gc.a x32
crtprec80.o libgcc_s_x32.so libobjc_gc.so