cancel
Showing results for 
Search instead for 
Did you mean: 

undefined reference to `cosf' `sinf'

SGold
Associate II

Hello, I'm compiling a custom project with STM32M7 using TouchGFX library on it. Recently, when I started to play with more advance functions from TouchGFX I get this error during the linking process:

.........../libtouchgfx-float-abi-hard.a(Math3D.o): In function `touchgfx::Matrix4x4::concatenateXRotation(float)':

(.text._ZN8touchgfx9Matrix4x420concatenateXRotationEf+0xc): undefined reference to `sinf'

(.text._ZN8touchgfx9Matrix4x420concatenateXRotationEf+0x18): undefined reference to `cosf'

I check some of the flags -lm is included in the case that uses the default math.h functions, but the error is in a different place.

I'm using libtouchgfx-float-abi-hard.a library and -mfloat-abi=hard.

Can anyone help me with this?

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions

Need to look more carefully at what library, and paths, it is pulling them from. Need to make sure you're not using a lite library lacking standard C math functions. Check also library ordering.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

2 REPLIES 2

Need to look more carefully at what library, and paths, it is pulling them from. Need to make sure you're not using a lite library lacking standard C math functions. Check also library ordering.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Awesome!, I just move the linker option flags and now is working 😀

Thank you!