vendredi 20 mars 2020

why does it build error when i only #include

i upgrade gcc to 5.4, it seems to be ok except math.h

when i write a hello.cpp like the following:

#include<math.h>
int main(){return 0;}

then i build the above cpp with gcc 5.4, g++ 5.4

g++ hello.cpp

errors happen

In file included from /usr/include/math.h:70:0,
                 from main.cpp:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:63:16: error: expected constructor, destructor, or type conversion before ‘(’ token
 __MATHCALL_VEC (cos,, (_Mdouble_ __x));
                ^
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:65:16: error: expected constructor, destructor, or type conversion before ‘(’ token
 __MATHCALL_VEC (sin,, (_Mdouble_ __x));
                ^
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:81:22: error: ‘sincos’ has not been declared
 __MATHDECL_VEC (void,sincos,,
                      ^
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:81:29: error: expected identifier before ‘,’ token
 __MATHDECL_VEC (void,sincos,,
                             ^
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:82:3: error: expected identifier before ‘(’ token

Aucun commentaire:

Enregistrer un commentaire