On Ubuntu, gcc 8.3.0,I compile test.cpp file:
#include<algorithm>
int main(){}
g++ -o test test.cpp
and get the following compile error
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.
The problem is may be caused by <algorithm>? After trying, when I use c++98, the problem doesn't appear, for example:
g++ -o test test.cpp --std=c++98 //compiling succeed
g++ -o test test.cpp --std=c++11 //compiling fail
I have reinstalled gcc and the error remains. In fact, I have a .cpp file that requires c++11, so I want to know how to compile .cpp files including <algorithm> through c++11.
Aucun commentaire:
Enregistrer un commentaire