Advertising (This ad goes away for registered users. You can Login or Register)

SDL Compilation Problem

Forum rules
Forum rule Nº 15 is strictly enforced in this subforum.
preloader
Posts: 81
Joined: Thu Feb 28, 2013 1:09 pm

SDL Compilation Problem

Post by preloader »

Hey guys, I'm trying to porting chip8 emulator for psp. I got a source code which is compiling under Mingw32 with SDL library but when I try to compile for psp I'm getting following errors

Code: Select all

psp-gcc -I. -IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -D PSP -D_PSP_FW_VERSION=1
50   -c -o main.o main.c
main.c: In function 'chip8_prepare':
main.c:121: warning: unused variable 'keys'
psp-gcc -I. -IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -D PSP -D_PSP_FW_VERSION=1
50  -L. -LC:/pspsdk/psp/sdk/lib -specs=C:/pspsdk/psp/sdk/lib/prxspecs -Wl,-q,-TC
:/pspsdk/psp/sdk/lib/linkfile.prx   main.o C:/pspsdk/psp/sdk/lib/prxexports.o -l
SDL  -lglut -lGLU -lGL -lm -lc -lpsputility -lpspdebug -lpspge -lpspdisplay -lps
pctrl -lpspsdk -lpspvfpu -lpsplibc -lpspuser -lpspkernel -lpsprtc -lpsppower -lp
spdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpsp
net_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o chip8.elf
c:/pspsdk/bin/../lib/gcc/psp/4.3.5/../../../../psp/lib\libSDL.a(SDL_pspaudio.o):
 In function `PSPAUD_CloseAudio':
src/audio/psp/SDL_pspaudio.c:134: undefined reference to `sceAudioChRelease'
c:/pspsdk/bin/../lib/gcc/psp/4.3.5/../../../../psp/lib\libSDL.a(SDL_pspaudio.o):
 In function `PSPAUD_PlayAudio':
src/audio/psp/SDL_pspaudio.c:120: undefined reference to `sceAudioOutputPannedBl
ocking'
src/audio/psp/SDL_pspaudio.c:118: undefined reference to `sceAudioOutputBlocking
'
c:/pspsdk/bin/../lib/gcc/psp/4.3.5/../../../../psp/lib\libSDL.a(SDL_pspaudio.o):
 In function `PSPAUD_OpenAudio':
src/audio/psp/SDL_pspaudio.c:194: undefined reference to `sceAudioChReserve'
c:/pspsdk/bin/../lib/gcc/psp/4.3.5/../../../../psp/lib\libSDL.a(SDL_pspvideo.o):
 In function `PSP_GuStretchBlit':
src/video/psp/SDL_pspvideo.c:629: undefined reference to `sceGuStart'
src/video/psp/SDL_pspvideo.c:630: undefined reference to `sceGuEnable'
src/video/psp/SDL_pspvideo.c:631: undefined reference to `sceGuTexMode'
src/video/psp/SDL_pspvideo.c:632: undefined reference to `sceGuTexFunc'
src/video/psp/SDL_pspvideo.c:633: undefined reference to `sceGuTexFilter'
src/video/psp/SDL_pspvideo.c:634: undefined reference to `sceGuTexImage'
src/video/psp/SDL_pspvideo.c:635: undefined reference to `sceGuTexSync'
src/video/psp/SDL_pspvideo.c:672: undefined reference to `sceGuDrawArray'
src/video/psp/SDL_pspvideo.c:639: undefined reference to `sceGuGetMemory'
src/video/psp/SDL_pspvideo.c:647: undefined reference to `sceGuTexImage'
src/video/psp/SDL_pspvideo.c:649: undefined reference to `sceGuTexSync'
src/video/psp/SDL_pspvideo.c:676: undefined reference to `sceGuFinish'
c:/pspsdk/bin/../lib/gcc/psp/4.3.5/../../../../psp/lib\libSDL.a(SDL_pspvideo.o):
 In function `PSP_FlipHWSurface':
src/video/psp/SDL_pspvideo.c:558: undefined reference to `sceGuSwapBuffers'
src/video/psp/SDL_pspvideo.c:551: undefined reference to `sceGuSync'
src/video/psp/SDL_pspvideo.c:558: undefined reference to `sceGuSwapBuffers'
c:/pspsdk/bin/../lib/gcc/psp/4.3.5/../../../../psp/lib\libSDL.a(SDL_pspvideo.o):
 In function `PSP_GuUpdateRects':
src/video/psp/SDL_pspvideo.c:734: undefined reference to `sceGuSync'
src/video/psp/SDL_pspvideo.c:734: undefined reference to `sceGuSync'
c:/pspsdk/bin/../lib/gcc/psp/4.3.5/../../../../psp/lib\libSDL.a(SDL_pspvideo.o):
 In function `PSP_FillHWRect':
src/video/psp/SDL_pspvideo.c:688: undefined reference to `sceGuStart'
src/video/psp/SDL_pspvideo.c:690: undefined reference to `sceGuGetMemory'
src/video/psp/SDL_pspvideo.c:697: undefined reference to `sceGuDrawBuffer'
src/video/psp/SDL_pspvideo.c:701: undefined reference to `sceGuColor'
src/video/psp/SDL_pspvideo.c:702: undefined reference to `sceGuDrawArray'
src/video/psp/SDL_pspvideo.c:704: undefined reference to `sceGuDrawBuffer'
src/video/psp/SDL_pspvideo.c:706: undefined reference to `sceGuFinish'
src/video/psp/SDL_pspvideo.c:707: undefined reference to `sceGuSync'
c:/pspsdk/bin/../lib/gcc/psp/4.3.5/../../../../psp/lib\libSDL.a(SDL_pspvideo.o):
 In function `HWAccelBlit':
src/video/psp/SDL_pspvideo.c:587: undefined reference to `sceGuStart'
src/video/psp/SDL_pspvideo.c:589: undefined reference to `sceGuCopyImage'
src/video/psp/SDL_pspvideo.c:595: undefined reference to `sceGuFinish'
src/video/psp/SDL_pspvideo.c:599: undefined reference to `sceGuSync'
c:/pspsdk/bin/../lib/gcc/psp/4.3.5/../../../../psp/lib\libSDL.a(SDL_pspvideo.o):
 In function `PSP_SetColors':
src/video/psp/SDL_pspvideo.c:759: undefined reference to `sceGuStart'
src/video/psp/SDL_pspvideo.c:760: undefined reference to `sceGuClutLoad'
src/video/psp/SDL_pspvideo.c:761: undefined reference to `sceGuFinish'
src/video/psp/SDL_pspvideo.c:762: undefined reference to `sceGuSync'
c:/pspsdk/bin/../lib/gcc/psp/4.3.5/../../../../psp/lib\libSDL.a(SDL_pspvideo.o):
 In function `PSP_VideoQuit':
src/video/psp/SDL_pspvideo.c:777: undefined reference to `sceGuTerm'
c:/pspsdk/bin/../lib/gcc/psp/4.3.5/../../../../psp/lib\libSDL.a(SDL_pspvideo.o):
 In function `PSP_SetVideoMode':
src/video/psp/SDL_pspvideo.c:250: undefined reference to `sceGuInit'
src/video/psp/SDL_pspvideo.c:251: undefined reference to `sceGuStart'
src/video/psp/SDL_pspvideo.c:252: undefined reference to `sceGuDispBuffer'
src/video/psp/SDL_pspvideo.c:257: undefined reference to `sceGuDrawBuffer'
src/video/psp/SDL_pspvideo.c:259: undefined reference to `sceGuClear'
src/video/psp/SDL_pspvideo.c:260: undefined reference to `sceGuOffset'
src/video/psp/SDL_pspvideo.c:261: undefined reference to `sceGuViewport'
src/video/psp/SDL_pspvideo.c:262: undefined reference to `sceGuScissor'
src/video/psp/SDL_pspvideo.c:263: undefined reference to `sceGuEnable'
src/video/psp/SDL_pspvideo.c:264: undefined reference to `sceGuFrontFace'
src/video/psp/SDL_pspvideo.c:266: undefined reference to `sceGuFinish'
src/video/psp/SDL_pspvideo.c:267: undefined reference to `sceGuSync'
src/video/psp/SDL_pspvideo.c:270: undefined reference to `sceGuDisplay'
src/video/psp/SDL_pspvideo.c:254: undefined reference to `sceGuClutMode'
src/video/psp/SDL_pspvideo.c:255: undefined reference to `sceGuDrawBuffer'
c:/pspsdk/bin/../lib/gcc/psp/4.3.5/../../../../psp/lib\libSDL.a(SDL_pspevents.o)
: In function `PSP_EventQuit':
src/video/psp/SDL_pspevents.c:274: undefined reference to `pspIrKeybFinish'
c:/pspsdk/bin/../lib/gcc/psp/4.3.5/../../../../psp/lib\libSDL.a(SDL_pspevents.o)
: In function `PSP_EventInit':
src/video/psp/SDL_pspevents.c:247: undefined reference to `pspIrKeybInit'
src/video/psp/SDL_pspevents.c:249: undefined reference to `pspIrKeybOutputMode'
c:/pspsdk/bin/../lib/gcc/psp/4.3.5/../../../../psp/lib\libSDL.a(SDL_pspevents.o)
: In function `PSP_PumpEvents':
src/video/psp/SDL_pspevents.c:112: undefined reference to `pspIrKeybReadinput'
c:/pspsdk/bin/../lib/gcc/psp/4.3.5/../../../../psp/lib\libSDL.a(SDL_pspevents.o)
: In function `EventUpdate':
src/video/psp/SDL_pspevents.c:71: undefined reference to `sceHprmPeekCurrentKey'

make: *** [chip8.elf] Error 1

makefile:

Code: Select all

TARGET = chip8
OBJS = main.o 

INCDIR = 
CFLAGS = -O2 -G0 -Wall -D PSP
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBS = -lSDL  -lglut -lGLU -lGL -lm -lc -lpsputility -lpspdebug -lpspge -lpspdisplay -lpspctrl -lpspsdk -lpspvfpu -lpsplibc -lpspuser -lpspkernel -lpsprtc -lpsppower

LIBDIR =
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = CHIP8 EMU

BUILD_PRX = 1


PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Thanks is advance
Advertising
Joel16
Posts: 914
Joined: Wed Oct 12, 2011 8:47 pm

Re: SDL Compilation Problem

Post by Joel16 »

Hi It seems to be a problem with linking the libraries in the makefile. Try replacing yours with this.

Code: Select all

LIBS += -lSDL_image -lSDL -lSDLmain -lpsppower -lc -lpng -lm -lz -ljpeg \
        -lpspgu -lpsphprm -lpspaudio
Advertising
"Forever in darkness, a guardian devil."
preloader
Posts: 81
Joined: Thu Feb 28, 2013 1:09 pm

Re: SDL Compilation Problem

Post by preloader »

Thanks, fixed some errors but still getting some...

Code: Select all

psp-gcc -I. -IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -D PSP -D_PSP_FW_VERSION=1
50   -c -o main.o main.c
psp-gcc -I. -IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -D PSP -D_PSP_FW_VERSION=1
50  -L. -LC:/pspsdk/psp/sdk/lib -specs=C:/pspsdk/psp/sdk/lib/prxspecs -Wl,-q,-TC
:/pspsdk/psp/sdk/lib/linkfile.prx   main.o C:/pspsdk/psp/sdk/lib/prxexports.o -l
SDL_image -lSDL -lSDLmain -lpsppower -lc -lpng -lm -lz -ljpeg -lpspgu -lpsphprm
-lpspaudio -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpsp
net_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o
chip8.elf
c:/pspsdk/bin/../lib/gcc/psp/4.3.5/../../../../psp/lib\libSDL.a(SDL_pspevents.o)
: In function `PSP_EventQuit':
src/video/psp/SDL_pspevents.c:274: undefined reference to `pspIrKeybFinish'
c:/pspsdk/bin/../lib/gcc/psp/4.3.5/../../../../psp/lib\libSDL.a(SDL_pspevents.o)
: In function `PSP_EventInit':
src/video/psp/SDL_pspevents.c:247: undefined reference to `pspIrKeybInit'
src/video/psp/SDL_pspevents.c:249: undefined reference to `pspIrKeybOutputMode'
c:/pspsdk/bin/../lib/gcc/psp/4.3.5/../../../../psp/lib\libSDL.a(SDL_pspevents.o)
: In function `PSP_PumpEvents':
src/video/psp/SDL_pspevents.c:112: undefined reference to `pspIrKeybReadinput'
make: *** [chip8.elf] Error 1

EDIT: Fixed problem with this

Code: Select all

LIBS = -lSDL -lSDL_ttf -lSDL_image -lpspirkeyb -lpspwlan -lpsppower -lGL -l freetype -ljpeg -lpng -lz -lm -lSDL -lpspgu -l psphprm -lpspaudio -lstdc++ -lpspvfpu -lpsprtc
now, im developing chip8 emulator for PSP ! 8-)
Joel16
Posts: 914
Joined: Wed Oct 12, 2011 8:47 pm

Re: SDL Compilation Problem

Post by Joel16 »

Glad to know you got it working :)
"Forever in darkness, a guardian devil."
preloader
Posts: 81
Joined: Thu Feb 28, 2013 1:09 pm

Re: SDL Compilation Problem

Post by preloader »

sauske_firekid wrote:Glad to know you got it working :)
Thanks, btw joel what do you think about the SDL performance on PSP ? Should I use another library for my chip8 emulator ?
Joel16
Posts: 914
Joined: Wed Oct 12, 2011 8:47 pm

Re: SDL Compilation Problem

Post by Joel16 »

preloader wrote:
sauske_firekid wrote:Glad to know you got it working :)
Thanks, btw joel what do you think about the SDL performance on PSP ? Should I use another library for my chip8 emulator ?
Hey, no probs, you fixed it yourself anyway ;)
About SDL, honestly I've never used it, I've only used PSP Gu, OSlib and Glib2D so I can't say. I believe someone like @noname120 and @Omega2508 may know :P
I've only looked at a few SDL sources but never really went toying around with it. I heard some users saying its a bit more advanced, but that's about it.
"Forever in darkness, a guardian devil."
preloader
Posts: 81
Joined: Thu Feb 28, 2013 1:09 pm

Re: SDL Compilation Problem

Post by preloader »

sauske_firekid wrote:
preloader wrote:
sauske_firekid wrote:Glad to know you got it working :)
Thanks, btw joel what do you think about the SDL performance on PSP ? Should I use another library for my chip8 emulator ?
Hey, no probs, you fixed it yourself anyway ;)
About SDL, honestly I've never used it, I've only used PSP Gu, OSlib and Glib2D so I can't say. I believe someone like @noname120 and @Omega2508 may know :P
I've only looked at a few SDL sources but never really went toying around with it. I heard some users saying its a bit more advanced, but that's about it.
I decided to use PSP GU because SDL was a bit buggy don't know why and I didn't fixed it. Work in progress;

XMB
Image

Space Invaders
Image

Tetris
Image

Pong
Image

Now, I have to create a simple file browser for picking the chip8 roms then it'll be ready for the first beta release :)
Joel16
Posts: 914
Joined: Wed Oct 12, 2011 8:47 pm

Re: SDL Compilation Problem

Post by Joel16 »

Looking good already, nice work ;)
"Forever in darkness, a guardian devil."
preloader
Posts: 81
Joined: Thu Feb 28, 2013 1:09 pm

Re: SDL Compilation Problem

Post by preloader »

sauske_firekid wrote:Looking good already, nice work ;)
Thanks, still got alot of work to do especially, button inputs and chip8's classic beep sound
Joel16
Posts: 914
Joined: Wed Oct 12, 2011 8:47 pm

Re: SDL Compilation Problem

Post by Joel16 »

preloader wrote:
sauske_firekid wrote:Looking good already, nice work ;)
Thanks, still got alot of work to do especially, button inputs and chip8's classic beep sound
You should push your sources to github that more devs can contribute or get something out of it. I'd like to help out if you wish :)
"Forever in darkness, a guardian devil."
Locked

Return to “Programming and Security”