undefined reference to `___ashrsi3'

I get the linker error

undefined reference to `___ashrsi3'

when compiling any code involving sprites. I've narrowed down specifically what code causes the problem:

static void set_sprite(PICTURE *pcptr) {
TEXTURE *txptr;

txptr = tex_spr + pcptr->texno;

slDMACopy((void *)pcptr->pcsrc,
(void *)(SpriteVRAM + ((txptr->CGadr) << 3)),
(Uint32)((txptr->Hsize * txptr->Vsize * 4) >> (pcptr->cmode)));
}

When I comment out this code, the error goes away. However, then I can't see any sprites.

Looking on Google, there seems to be some link with the math library (libm.a). I try to link with the library with -lm, but that doesn't do anything. I also try to add #include <math.h> and that doesn't help either. I'm wondering if maybe ashrsi3 is in an older version of libraries.

Does anyone have any idea?
 
Haha. Solved again. The SGL "made-for-Unix" is incomplete. I used DosBox to compile with the regular SGL and it worked fine. Off to making some stuffs.
 
aeroflot said:
Haha. Solved again. The SGL "made-for-Unix" is incomplete. I used DosBox to compile with the regular SGL and it worked fine. Off to making some stuffs.
maybe check this :

https://github.com/SaturnSDK/Saturn-SDK-SGL

i think it can help
 
Thanks for pointing that out. I will check it out. Would make it super easy if I could compile everything from withing linux.
 
Back
Top