~/alt
LLVM-Clangトランク(2012年4月23日)をUbuntu 12.04でGCC-4.6を使用して正常にビルドおよびインストールし、次にこのClang-buildを使用してlibc++をインストールしました。使いたいときは、次の両方-lc++
を用意する必要があります。-libstdc++
/home/per/alt/bin/clang -x c++ -I/home/per/alt/include/v1 -L/home/per/alt/lib -std=gnu++0x -g -Wall ~/f.cpp -lm -lc++ -lstdc++ -lpthread -o f
f.cpp
を含むコンパイル
#include <iostream>
using std::cout;
using std::endl;
int main(int argc, const char * argv[]) {
cout << "sxx" << endl;
return 0;
}
省略する-lstdc++
と、リンクエラーが発生します
/home/per/alt/include/v1/ostream:989: error: undefined reference to '__cxa_begin_catch'
/home/per/alt/include/v1/ostream:993: error: undefined reference to '__cxa_end_catch'
/home/per/alt/include/v1/ostream:993: error: undefined reference to '__cxa_end_catch'
/tmp/f-4l9mgl.o(.eh_frame+0xd3): error: undefined reference to '__gxx_personality_v0'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Compilation exited abnormally with code 1 at Tue Apr 24 13:59:22
libc++
の完全な代替品ではありませlibstdc++
んか?