每当我尝试使用IOStream编译C ++文件时,我都会收到此错误..我已尝试重新安装GCC G ++(4.6和4.9)和cpp ..它没有帮助(或者我没有做到这一点正确的方法)。如何修复此错误
In file included from /usr/include/c++/4.9/bits/localefwd.h:40:0,
from /usr/include/c++/4.9/ios:41,
from /usr/include/c++/4.9/ostream:38,
from /usr/include/c++/4.9/iostream:39,
from Integration_Any.cpp:1:
/usr/include/x86_64-linux-gnu/c++/4.9/bits/c++locale.h:52:23: error:‘uselocale’was not declared in this scope
extern "C" __typeof(uselocale) __uselocale;
^
/usr/include/x86_64-linux-gnu/c++/4.9/bits/c++locale.h:52:45: error: invalid type in declaration before ‘;’ token
extern "C" __typeof(uselocale) __uselocale;
^
/usr/include/x86_64-linux-gnu/c++/4.9/bits/c++locale.h: In function ‘int std::__convert_from_v(__locale_struct* const&, char*, int, const char*, ...)’: /usr/include/x86_64-linux-gnu/c++/4.9/bits/c++locale.h:75:53: error: ‘__gnu_cxx::__uselocale’ cannot be used as a function
__c_locale __old = __gnu_cxx::__uselocale(__cloc);
^
/usr/include/x86_64-linux-gnu/c++/4.9/bits/c++locale.h:100:33: error: ‘__gnu_cxx::__uselocale’ cannot be used as a function
__gnu_cxx::__uselocale(__old);
^
答案 0 :(得分:0)
我使用openmpi和更新版本的g ++看到了同样的错误。 您可能正在使用使用其他C ++编译器编译的mpi安装。比较mpicxx -v和g ++ -v的输出。我想mpicxx -v会显示一个比你更老的g ++版本,并用你正在使用的更新的g ++版本重新安装你的mpi。