After upgrade to 14.04 from 12.04 clang++ stopped working.
$ cat test.cpp
#include <iostream>
int main()
{ std::cout << "Hello World" << std::endl; return 0;
}
$ clang++ test.cpp
test.cpp:1:10: fatal error: 'iostream' file not found
#include <iostream> ^
1 error generatedInstalled with apt-get install clag-3.5 same happened with clang-3.4
Thanks
42 Answers
I found to resolve this issue that after installing libstdc++-4.8-dev package, I need to specify the include paths and lib path to the clang++ like this.
clang++ -I/usr/include/c++/4.8/ -I/usr/include/x86_64-linux-gnu/c++/4.8 -L /usr/lib/gcc/x86_64-linux-gnu/4.8 test.cpp -o test 1 Your code works for me. Make sure you have libstdc++-dev installed. It's a virtual package, and in my case (Ubuntu 14.04.2 LTS) having 4.8 works.
sudo apt-get install libstdc++-4.8-dev 2