无法编译任何C ++代码

问题描述 投票:3回答:1

每当我尝试使用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);
                             ^
c++ g++ ubuntu-12.04
1个回答
0
投票

我使用openmpi和更新版本的g ++看到了同样的错误。您可能正在使用使用其他C ++编译器编译的mpi安装。比较mpicxx -v和g ++ -v的输出。我猜mpicxx -v将显示比你更老的g ++版本,并使用你正在使用的较新的g ++版本重新安装你的mpi。

© www.soinside.com 2019 - 2024. All rights reserved.