HomeForumsWhat's newResources 
 
 
undefined reference to `___ashrsi3'
aeroflot - Nov 23, 2014
 aeroflot Nov 23, 2014
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 and that doesn't help either. I'm wondering if maybe ashrsi3 is in an older version of libraries.

Does anyone have any idea?

 aeroflot Nov 24, 2014
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.

 vbt Nov 26, 2014

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

 aeroflot Nov 29, 2014
Thanks for pointing that out. I will check it out. Would make it super easy if I could compile everything from withing linux.