如何解决g++问题"internal compiler error: Illegal instruction min() _GLIBCXX_USE_NOEXCEPT { return __FLT_MI
How to solve the g++ problem "internal compiler error: Illegal instruction min() _GLIBCXX_USE_NOEXCEPT { return __FLT_MIN__; }"?
在Ubuntu
、gcc 8.3.0
上,我编译test.cpp
文件:
#include<algorithm>
int main(){}
g++ -o test test.cpp
并得到以下编译错误
In file included from /usr/include/c++/8/bits/uniform_int_dist.h:35,
from /usr/include/c++/8/bits/stl_algo.h:66,
from /usr/include/c++/8/algorithm:62,
from test.cpp:1:
/usr/include/c++/8/limits:1599:7: internal compiler error: Illegal instruction
min() _GLIBCXX_USE_NOEXCEPT { return __FLT_MIN__; }
^~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-8/README.Bugs> for instructions.
问题可能是由<algorithm>
引起的?经过尝试,当我使用c++98时,问题没有出现,例如:
g++ -o test test.cpp --std=c++98 //compiling succeed
g++ -o test test.cpp --std=c++11 //compiling fail
我已经重新安装了gcc,错误仍然存在。事实上,我有一个.cpp
文件需要c++11
,所以我想知道如何通过c++11编译包括<algorithm>
在内的.cpp
文件。
您的代码是正确的,这是一个GCC 8错误。这就是错误消息指向Readme.Bugs
的原因。新的GCC 9有一个PPA。
相关文章:
- 如何使用std::min和std::less返回对象
- 为什么 -mmacosx-version-min=10.10 不阻止使用标记为从 10.11 开始的函数?
- 关于 std::min, std::max 中的比较运算符的混淆
- glibcxx STL 在实现 std::valarray::sum() 时是否不正确?
- 使用 CImg 库的 std::min 和 std::max 的编译问题
- 为什么将 1 添加到 numeric_limits<float>::min() 返回 1?
- 如何将要求降级到动态库的 glibcxx 3.4.20?
- 在儿童的特定情况下,向下渗透MIN二进制堆失败
- 在f2c.h文件中定义min()max()宏时出错
- 如何解决g++问题"internal compiler error: Illegal instruction min() _GLIBCXX_USE_NOEXCEPT { return __FLT_MI
- 第 5 行:字符 54:错误:调用"min(int,std::__cxx11::basic_string<char>::size_type)"没有匹配函数
- 如何使用函数std::min()来计算最小值
- 在函数 'int main(int, char**) 中,没有声明 'MIN'
- 将迭代器值与 std::min 一起固定到 end()
- C++是否在 std::min 和 std::max 下标准化 std::optional 的行为?
- c++ 中 std::min 的效率
- 使用稍旧版本的 GLIBCXX
- 当摆脱模偏差时,min = -upper_bound % upper_bound; // 如何工作?
- std :: min-设计考虑
- 如何在 OpenACC 中并行化内部具有"min"功能的循环