M_PI flagged as undeclared identifier

前端 未结 5 1722
走了就别回头了
走了就别回头了 2020-12-24 05:36

When I compile the code below, I got these error messages:

(Error  1   error C2065: \'M_PI\' : undeclared identifier 
2   IntelliSense: identifier \"M_PI\"          


        
5条回答
  •  不思量自难忘°
    2020-12-24 06:17

    M_PI is supported by GCC too, but you've to do some work to get it

    #undef __STRICT_ANSI__
    #include 
    

    or if you don't like to pollute your source file, then do

    g++ -U__STRICT_ANSI__ 
    

提交回复
热议问题