fatal error: ext/type_traits.h: No such file or directory
Here is my error:
root@:lab1# g++ lab1.cpp
In file included from /usr/include/c++/5/bits/char_traits.h:39:0, from /usr/include/c++/5/ios:40, from /usr/include/c++/5/ostream:38, from /usr/include/c++/5/iostream:39, from lab1.cpp:1:
/usr/include/c++/5/bits/stl_algobase.h:62:29: fatal error: ext/type_traits.h: No such file or directory
compilation terminated./usr/include/c++/5/ext is empty:
My guess is that this error is caused by missing files in that folder, but I don't know for sure. Maybe somebody knows how to re-download c++ headers?
Any help would be much appreciated!
41 Answer
Reinstalling libstdc++-5-dev fixed this. steeldriver provided this solution in a comment:
Have you tried simply re-installing the
libstdc++-5-devpackage?
– steeldriver Dec 19 '16 at 19:07
The original poster confirmed that this solved the problem.
For the benefit of others who find this question by searching, one way to completely reinstall that package is to run:
sudo apt-get update
sudo apt-get --purge --reinstall install libstdc++-5-devThe reason this is able to solve the problem is that the libstdc++-5-dev package provides C++ standard library headers.