Fighting with lib linking
Posted: Wed Jun 18, 2014 7:44 pm
Hi there,
I hope you'll be able to help me on this one again because it's making me crazy !
So, I have a lib and a game
Lib calls severals function of SGDK
game call severals function of Lib and SGDK
Let's say Lib call
- VDP_setHorizontalScroll() from vdp_bg.c/.h, into a scroll function
- VDP_setVerticalScroll() from vdp_bg.c/.h, into a scroll function
- JOY_init() from joy.c, into a joy_start() function
Let's say game call
- JOY_init() from joy.c/.h
- Joy_start() from lib
- scroll() from lin
My problem ?
Joy_start() perfectly works
scroll() produce a "undefined reference to VDP_setHorizontalScroll()/VDP_setVerticalScroll()"
From what I understood, for scroll() to work, I must make reference somewhere (in my game) to vdp_bg.c/.h to game link to sgdk.vdp_bg and lib could so use sgdk.vdp_bg function.
I'm very poor on linking and library stuff so does someone could help me to find the right way to compile Lib.a or/and to link Link.a without undefined reference errors ?
thanks a lot !
I hope you'll be able to help me on this one again because it's making me crazy !
So, I have a lib and a game
Lib calls severals function of SGDK
game call severals function of Lib and SGDK
Let's say Lib call
- VDP_setHorizontalScroll() from vdp_bg.c/.h, into a scroll function
- VDP_setVerticalScroll() from vdp_bg.c/.h, into a scroll function
- JOY_init() from joy.c, into a joy_start() function
Let's say game call
- JOY_init() from joy.c/.h
- Joy_start() from lib
- scroll() from lin
My problem ?
Joy_start() perfectly works
scroll() produce a "undefined reference to VDP_setHorizontalScroll()/VDP_setVerticalScroll()"
From what I understood, for scroll() to work, I must make reference somewhere (in my game) to vdp_bg.c/.h to game link to sgdk.vdp_bg and lib could so use sgdk.vdp_bg function.
I'm very poor on linking and library stuff so does someone could help me to find the right way to compile Lib.a or/and to link Link.a without undefined reference errors ?
thanks a lot !