| View previous topic :: View next topic |
| Author |
Message |
McZonk
Joined: 14 Jul 2005 Posts: 35 Location: Germany
|
Posted: Sat Aug 06, 2005 4:41 pm Post subject: Another issue with sinf cosf and sqrtf (External Lib) |
|
|
I'm working on a math library for the PSP in C.
| Code: | float float2_length(float2* a) {
return sqrtf(a->x * a->x + a->y * a->y);
} |
And a lot of stuff like this. I compile this lib with psp-gcc and make an static library with psp-ar.
Then I add the lib path and the library to my psp-project Makefile, but when I compile this i get an linker error: undefined refernce to sqrtf.
I can use the sqrtf function in the psp-project without getting this error. So I tried to add the math library (-lm) and path to the library Makefile, but that didn't solve it. The confusing thing is, I can use some other functions in my library with out getting linker errors. I used the sceIo... functions and it work. Why not the math functions?
Yes i tried to search for this problem and found a lot of sqrtf problems, but using sqrtf in my main.c is not the problem. Install new toolchain and sdk didn't fix it too. |
|
| Back to top |
|
 |
chp
Joined: 23 Jun 2004 Posts: 313
|
Posted: Sat Aug 06, 2005 5:35 pm Post subject: |
|
|
Make sure you place -lm AFTER your library in the library-order. When using GCC, link-order matters. _________________ GE Dominator |
|
| Back to top |
|
 |
McZonk
Joined: 14 Jul 2005 Posts: 35 Location: Germany
|
Posted: Sat Aug 06, 2005 5:44 pm Post subject: |
|
|
Solved. thx chp!
Close. |
|
| Back to top |
|
 |
|