SDL linking cannot find definition of Unlock Surface

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

Moderators: cheriff, TyRaNiD

Post Reply
platform
Posts: 13
Joined: Wed Aug 26, 2009 5:53 pm

SDL linking cannot find definition of Unlock Surface

Post by platform »

Hi all,

As you can see from the linker error below the definition of SDL_UnLockSurface is not available to me. This is made all the stranger by the fact that SDL_LockSurface is!

Could someone pass their eyes over the command below and verify if I've got all the necessary linker flags present?

It would be much appreciated.

psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I/usr/local/pspdev/psp/include/SDL -Dmain=SDL_main -D PSP_BUILD -D_PSP_FW_VERSION=150 -L. -L/usr/local/pspdev/psp/sdk/lib main.o entities/playerentity.o entities/platform.o collision/collision.o entities/entity.o animation/animationManager.o animation/spriteutils.o system/input.o system/screen.o ingameUI/viewport.o -lSDL_image -L/usr/local/pspdev/psp/lib -lSDLmain -lSDL -lm -L/usr/local/pspdev/psp/sdk/lib -lpspdebug -lpspgu -lpspctrl -lpspge -lpspdisplay -lpsphprm -lpspsdk -lpsprtc -lpspaudio -lc -lpspuser -lpsputility -lpspkernel -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o build/psp/simplePlatform.elf
animation/spriteutils.o: In function `SPR_YaxisReflectAndBlitSpriteTo':
spriteutils.c:(.text+0x580): undefined reference to `SDL_UnLockSurface'
jsharrad
Posts: 100
Joined: Thu Oct 20, 2005 3:06 am

Post by jsharrad »

It's case sensitive ... SDL_UnlockSurface
platform
Posts: 13
Joined: Wed Aug 26, 2009 5:53 pm

Post by platform »

jsharrad wrote:It's case sensitive ... SDL_UnlockSurface
It is indeed, good catch.

Now, this is somewhat academic, but does anyone know why that builds fine for my OSX build but not for PSP?
svxs
Posts: 15
Joined: Fri Jun 19, 2009 10:03 am

Post by svxs »

Is it a similar error message?
jojojoris
Posts: 255
Joined: Sun Mar 30, 2008 4:06 am

Post by jojojoris »

svxs wrote:Is it a similar error message?
...on my OSX is builds fine...

So there is no second error.

Code: Select all

int main(){
     SetupCallbacks();
     makeNiceGame();
     sceKernelExitGame();
}
svxs
Posts: 15
Joined: Fri Jun 19, 2009 10:03 am

Post by svxs »

I see. I mistook the way he worded it to mean that his project compiled properly for OSX when using libraries and tools that are unrelated to the PSP, yet generated an unrelated compiling or linking error when being built for the PSP.

An odd issue if the OSX build is still erroneously letting the binary get linked to the improperly spelled function. No clue. Does it crash?
platform
Posts: 13
Joined: Wed Aug 26, 2009 5:53 pm

Post by platform »

svxs wrote:An odd issue if the OSX build is still erroneously letting the binary get linked to the improperly spelled function. No clue. Does it crash?
That's correct, OSX was compiling and running the improperly spelt function using an unrelated SDL implementation. My guess is that there is a typedef hidden in the OSX headers somewhere.

Any way, not the most important issue. I just wondered if anyone had encountred this.
svxs
Posts: 15
Joined: Fri Jun 19, 2009 10:03 am

Post by svxs »

Figured the idea of SDL was to enhance portability. Curious for there to be things to encourage unportable code in that implementation...
Post Reply