Could anyone say what is the problem with my code?
main.cpp
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspgu.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <pspdisplay.h>
#include <malloc.h>
#include <SDL/SDL.h>
PSP_MODULE_INFO("Hello World", 0, 1, 1);
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common)
{
sceKernelExitGame();
return 0;
}
/* Callback thread */
int CallbackThread(SceSize args, void *argp)
{
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void)
{
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0)
{
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
int main( int argc, char* args[] )
{
pspDebugScreenInit();
SetupCallbacks();
//The images
SDL_Surface* hello = NULL;
SDL_Surface* screen = NULL;
//Start SDL
SDL_Init( SDL_INIT_EVERYTHING );
//Set up screen
screen = SDL_SetVideoMode( 320, 240, 32, SDL_SWSURFACE );
//Load image
hello = SDL_LoadBMP( "psp.bmp" );
//Apply image to screen
SDL_BlitSurface( hello, NULL, screen, NULL );
//Update Screen
SDL_Flip( screen );
//Pause
SDL_Delay( 2000 );
//Free the loaded image
SDL_FreeSurface( hello );
//Quit SDL
SDL_Quit();
sceKernelSleepThread();
return 0;
}
Makefile
TARGET = main
OBJS = main.o
INCDIR =
CFLAGS = -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LDFLAGS =
LIBS= -lpspgum -lpspgu -lm -lsdl
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = SDL Sample
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
doing "make" in command prompt give me a nice(!?) error.
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\SDL_PSP>make
psp-gcc -I. -IC:/pspdev/psp/sdk/include -G0 -Wall -D_PSP_FW_VERSION=150 -L. -LC
:/pspdev/psp/sdk/lib main.o -lpspgum -lpspgu -lm -lsdl -lpspdebug -lpspdisplay
-lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_r
esolver -lpsputility -lpspuser -lpspkernel -o main.elf
c:/pspdev/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:/pspdev/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:/pspdev/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:/pspdev/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:/pspdev/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:/pspdev/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:/pspdev/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:/pspdev/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:/pspdev/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:/pspdev/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:/pspdev/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:/pspdev/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:/pspdev/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:/pspdev/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:/pspdev/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: *** [main.elf] Error 1
C:\SDL_PSP>
Errr

.....That was my first helloworld SDL for PSP.Plz help me.