lammy Q : error undefined reference to `sinf'

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Shinen
Posts: 8
Joined: Tue Oct 18, 2005 6:45 am
Location: Moscow

lammy Q : error undefined reference to `sinf'

Post by Shinen »

Hi all.

Have to start write something under psp and confuzed with such linker error:

undefined reference to `sinf'

so, i'm compile well few examples which used sinf and cosf. Try to understand my mistake but cant find it :( i'm use same includes and makefile but nothing ... so may be i miss something - can anyone can help with such, i guess, lame propblem ;)

p.s. so don't use C a long time (last 5-6 year write only on asm for MCU) and forget it completely... so trying to relearn it anew.
Shinen
Posts: 8
Joined: Tue Oct 18, 2005 6:45 am
Location: Moscow

Post by Shinen »

nevermind
so .... looks like no such functions available and must write my own ...
sandberg
Posts: 90
Joined: Wed Oct 05, 2005 1:25 am
Location: Denmark

Post by sandberg »

sinf does exist (along a lot of other math functions), but you need to link with the math library. add -lm when you link (you must add it before the objectfile or code that uses it).

If you can't make it work, then post your makefile, and I'll take a look.
Br, Sandberg
Shinen
Posts: 8
Joined: Tue Oct 18, 2005 6:45 am
Location: Moscow

Post by Shinen »

sandberg

thanks for reply :) i'm already resolve this problem (sdk update and -lm) thanks to chp on #amycoders channel :)
Post Reply