atan2f in math.h with S32DS S32K144

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

atan2f in math.h with S32DS S32K144

4,320件の閲覧回数
koehlerl
Contributor IV
Hello,
I use the S32DS with S32K144.
i want to use the atan2f function in my Project.
I include the math.h.
When i use the "atan2f()" I get the error: "undefined reference to `atan2f'
What is my Problem ?

BR Lutz

タグ(2)
0 件の賞賛
5 返答(返信)

3,859件の閲覧回数
b48014
NXP Employee
NXP Employee

Hi Lutz,

Looks like you should add math library in settings:

pastedImage_1.png

Best regards,

Dmitry

3,859件の閲覧回数
koehlerl
Contributor IV

Hello Dmitry,

I added m and it works.

Is there some documentation, where I can find witch library is how to add ?

BR

Lutz

Von: b48014

Gesendet: Donnerstag, 27. September 2018 12:55

An: Köhler, Lutz <lutz.koehler@acd-antriebstechnik.de>

Betreff: Re: - Re: atan2f in math.h with S32DS S32K144

NXP Community <https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg>

Re: atan2f in math.h with S32DS S32K144

reply from Dmitry Kudryavtsev<https://community.nxp.com/people/b48014?et=watches.email.thread> in S32 Design Studio - View the full discussion<https://community.nxp.com/message/1062020?commentID=1062020&et=watches.email.thread#comment-1062020>

0 件の賞賛

3,859件の閲覧回数
b48014
NXP Employee
NXP Employee

There are historical reasons why libm is not linked in by default in GCC. 

You can try to find information about libraries in the compiler documentation:
For example, {S32DS Path}/Cross_Tools/gcc-6.3-arm64-eabi/aarch64-none-elf/share/docs/html/libm/index.html

pastedImage_1.png

Best regards,

Dmitry

0 件の賞賛

3,111件の閲覧回数
jaynara
Contributor II

Hi, I got the same problem,differences is that I tried to call the math.h on S32 Design Studio for S32 Platform 3.4. But I have no idea about how to add the libm. I found the libm.a file in the Installation directory and try to add the absolute path in S32DS, but the compile console log will show some error.I still try to copy the libm.a to my local workspace, it did't work yet. Would you like to offer more details? Thank you.lib_setting.PNGcompile_error.PNG

0 件の賞賛

3,043件の閲覧回数
jiri_kral
NXP Employee
NXP Employee

Hi, 

your project and libm was build with different Float Point settings. Project probably uses Hard FP and libm is build with soft fp:

 

jiri_kral_0-1643651066841.png

I'm not sure if newlib contains Hard FP library, but EWL C has both - soft and hard.

 

Jiri 

 

0 件の賞賛