开发者

expected unqualified-id before numeric constant in STK code

开发者 https://www.devze.com 2023-04-01 10:21 出处:网络
I included the The Synthesis ToolKit in C++ (STK) from stanford into my project and when I try to build I get the following error:

I included the The Synthesis ToolKit in C++ (STK) from stanford into my project and when I try to build I get the following error:

error: expected unqualified-id before numeric constant

in the second line written here, from the STK.h: (in the part where they declare their namespace)

const StkFloat PI = 3.14159265358979;
const StkFloat TWO_PI   = 2 * PI;  

My code was compiling bef开发者_如何学JAVAore I added this, and surely there wouldn't be such a simple error in the STK code.

What am I doing wrong?


My guess is that some evil header defines PI as a macro.

Either find and destroy that header, or put #undef PI before including the toolkit header.

0

精彩评论

暂无评论...
验证码 换一张
取 消