I can compile and run c++ example in command line like this:
clang++ -std=c++11 -stdlib=libc++ Test.cpp
But when trying this in eclipse,I got these errors
12:58:18 **** Incremental Build of configuration Debug for project C++Test ****
Info: Internal Builder is used for build
clang++ -L/usr/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.8/ -o
C++Test src/C++Test.bc -llibc++ -lstdc++
/usr/bin/ld: cannot find -llibc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
There are two strange things here:
First,I have actually appended "-std=c++11 -stdlib=libc++" to compile command in project build settings,but it seems be ignored.Why?
Second,I have remove stdc++ from link libraries,but it will be added automatically each time,like this:
Update:add a picture to demo this problem
Then,I tried to remove libc++ from link libraries in project settings,compile it again,got bunch of errors like these:
Info: Internal Builder is used for build
clang++ -L/usr/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.8/ -o C++Test src/C++Test.bc -lstdc++
/tmp/C++Test-d24e4c.o: In function `main':
/home/alex/workspace/C++Test/Debug/../src/C++Test.cpp:12: undefined reference to `std::__1::cout'
/tmp/C++Test-d24e4c.o: In function `std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::operator<< <std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*)':
/usr/include/c++/v1/ostream:974: undefined reference to `std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::sentry(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)'
/tmp/C++Test-d24e4c.o: In function `std::__1::basic_ios<char, std::__1::char_traits<char> >::fill() const':
/usr/include/c++/v1/ios:734: undefined reference to `std::__1::ios_base::getloc() const'
......
"-std=c++11 -stdlib=libc++" ignored still,so how to get it work?