Linux:如何重新安装所有 stdlib

Linux:如何重新安装所有 stdlib

我尝试安装最新版本的 Clang 和 LLVM (3.9) (http://releases.llvm.org/download.html#3.9.1)因为 Debian 中用 apt-get 安装的 LLVM 版本是 3.5...

但作为一个菜鸟,我不知道该怎么做,我打破了/usr/include

#include <iostream>

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

我遇到了这个错误(apt-get 的 clang 版本,不是最新版本):

$ 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存在,但位于以下子文件夹中/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

我该如何重新安装并修复这些文件/usr/include

答案1

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

然后重新安装此包:

apt-get install --reinstall <package>

相关内容