Skip to main content
SGold
Associate II
Feb 10, 2020 4:22 PM UTC
Solved

undefined reference to `cosf' `sinf'

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.

This topic has been closed for replies.
Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Feb 10, 2020 4:31 PM UTC

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..

2 replies

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Feb 10, 2020 4:31 PM UTC

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
SGold
SGoldAuthor
Associate II
Feb 10, 2020 4:35 PM UTC

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

Thank you!