atan2f in math.h with S32DS S32K144

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

atan2f in math.h with S32DS S32K144

4,121 Views
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

Tags (2)
0 Kudos
5 Replies

3,660 Views
b48014
NXP Employee
NXP Employee

Hi Lutz,

Looks like you should add math library in settings:

pastedImage_1.png

Best regards,

Dmitry

3,660 Views
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 Kudos

3,660 Views
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 Kudos

2,912 Views
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 Kudos

2,844 Views
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 Kudos