Complex type CW MCU 10.2

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Complex type CW MCU 10.2

1,851件の閲覧回数
ioanacroitoru
Contributor I

Hello,

 

I need to use a complex type in order to see the result returned by std::polar.

I see that the CW10.2 contains <complex.h> with the next definition:

 

#define complex      _Complex;

 

complex is not recognized like a type but _Complex apperas to be a type(the style it's the same as a int or void). Yet I get next error:

 

undefined identifier '_Complex' ;

 

What can I use for a complex number if that is not correct?

ラベル(1)
タグ(2)
0 件の賞賛
返信
4 返答(返信)

1,653件の閲覧回数
carlos_neri
NXP Employee
NXP Employee

Have you tried to add C99 support on CW compiler options?

I think complex data type was integrated to C on C99 revision. For default, CW uses C without C99 , if you want C99 support you need to enable it on the compiler options.

1,653件の閲覧回数
hebo
Contributor I

Hi,

I  met the same problem, How to set C99 support on the compiler options,

0 件の賞賛
返信

1,653件の閲覧回数
ioanacroitoru
Contributor I

Hi,

First thank you for your answer.

Now I get the error

     "complex types are not implemented"

I'm guessing that I can't use complex type alter all? Or what does this means?

0 件の賞賛
返信

1,653件の閲覧回数
carlos_neri
NXP Employee
NXP Employee

Not sure which MCU device you're using, but here is my findings:

It seems the Freescale ARM compiler does not supported, need to double check that (got the same result as you).

I did the same test with GCC compiler within CW10.4 and it seems it supports it. Probably if your application allows it, you could move to GCC compiler using CW10,4?

0 件の賞賛
返信