Linux: How to reinstall all stdlib

0

I have tried to install the latest version of Clang and LLVM (3.9) (http://releases.llvm.org/download.html#3.9.1) because the version of LLVM in Debian with apt-get is the 3.5...

But as a noob, I don't know how, I broke /usr/include:

#include <iostream>

int main()
{
  std::cout << "Hello World!" << std::endl;
}

I have this error (apt-get's version of clang, not the latest):

$ clang test.cpp
In file included from test.cpp:1:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/iostream:39:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:38:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ios:38:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/iosfwd:40:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/postypes.h:40:
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/cwchar:44:10: fatal error: 'wchar.h' file not found
#include <wchar.h>
         ^
1 error generated.

wchar.h exists but is in a subfolder of /usr/include:

$ find /usr/include -name 'wchar.h'
/usr/include/bsd/wchar.h
/usr/include/c++/4.9/tr1/wchar.h
/usr/include/x86_64-linux-gnu/bits/wchar.h

How can I reinstall and fix these files in /usr/include?

Ardakaniz

Posted 2017-01-25T17:28:57.837

Reputation: 1

Answers

0

dpkg -S `realpath /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/cwchar`

Then reinstall this package:

apt-get install --reinstall <package>

Ipor Sircer

Posted 2017-01-25T17:28:57.837

Reputation: 3 578

It doesn't work :/ Same problem after reinstallation – Ardakaniz – 2017-01-25T17:51:39.073

do it with all files which are affected. – Ipor Sircer – 2017-01-25T18:15:35.683

Sorry, many friends recommended me to install Arch instead of Debian because of his old packages, so now I have no more problem :) – Ardakaniz – 2017-01-30T05:52:29.177