[Solved] PSP & SDL problem
Posted: Sat Feb 13, 2010 7:22 am
I followed a tutorial on how to get a psp sdk to work. I can compile the examples and such. But when I try to use the makefile that should be used with sdl it dont work to compile.
The tutorial i followed: http://www.consolespot.net/forums/psp-h ... ygwin.html
Error:
CODE:
Makefile:
Thanks for help
The tutorial i followed: http://www.consolespot.net/forums/psp-h ... ygwin.html
Error:
Code: Select all
C:\pspdev\psp\sdk\mystuff>make
psp-gcc -I. -IC:/pspdev/psp/sdk/include -O2 -G0 -Wall -D PSP -IC:/pspdev/psp/inc
lude/SDL -Dmain=SDL_main -D_PSP_FW_VERSION=150 -L. -LC:/pspdev/psp/sdk/lib m
ain.o -lstdc++ -lSDL_ttf -lfreetype -lSDL_image -ljpeg -lpng -lz -lm -lSDL_mixer
-lvorbisidec -lmikmod -lmad -LC:/pspdev/psp/lib -lSDLmain -lSDL -lm -lGL -lpspv
fpu -LC:/pspdev/psp/sdk/lib -lpspdebug -lpspgu -lpspctrl -lpspge -lpspdisplay -l
psphprm -lpspsdk -lpsprtc -lpspaudio -lc -lpspuser -lpsputility -lpspkernel -lps
pnet_inet -lpspaudiolib -lpspaudio -lpsppower -lpspdebug -lpspdisplay -lpspge -
lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -l
psputility -lpspuser -lpspkernel -o testprogram.elf
C:/pspdev/psp/lib\libSDLmain.a(SDL_psp_main.o): In function `sdl_psp_setup_callb
acks':
psp/SDL_psp_main.c:71: multiple definition of `module_info'
main.o:(.rodata.sceModuleInfo+0x0): first defined here
collect2: ld returned 1 exit status
make: *** [testprogram.elf] Error 1
Code: Select all
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* main.c - Basic Input demo -- reads from control pad and indicates button
* presses.
*
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
* Copyright (c) 2005 Donour Sizemore <donour@uchicago.edu>
*
* $Id: main.c 1095 2005-09-27 21:02:16Z jim $
*/
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspctrl.h>
#include <stdlib.h>
#include <string.h>
/* Define the module info section */
PSP_MODULE_INFO("CONTROLTEST", 0, 1, 1);
/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
/* Define printf, just to make typing easier */
#define printf pspDebugScreenPrintf
void dump_threadstatus(void);
int done = 0;
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common)
{
done = 1;
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(void)
{
SceCtrlData pad;
pspDebugScreenInit();
SetupCallbacks();
sceCtrlSetSamplingCycle(0);
sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);
while(!done){
pspDebugScreenSetXY(0, 2);
sceCtrlReadBufferPositive(&pad, 1);
printf("Analog X = %d ", pad.Lx);
printf("Analog Y = %d \n", pad.Ly);
if (pad.Buttons != 0){
if (pad.Buttons & PSP_CTRL_SQUARE){
printf("Square pressed \n");
}
if (pad.Buttons & PSP_CTRL_TRIANGLE){
printf("Triangle pressed \n");
}
if (pad.Buttons & PSP_CTRL_CIRCLE){
printf("Cicle pressed \n");
}
if (pad.Buttons & PSP_CTRL_CROSS){
printf("Cross pressed \n");
}
if (pad.Buttons & PSP_CTRL_UP){
printf("Up pressed \n");
}
if (pad.Buttons & PSP_CTRL_DOWN){
printf("Down pressed \n");
}
if (pad.Buttons & PSP_CTRL_LEFT){
printf("Left pressed \n");
}
if (pad.Buttons & PSP_CTRL_RIGHT){
printf("Right pressed \n");
}
if (pad.Buttons & PSP_CTRL_START){
printf("Start pressed \n");
}
if (pad.Buttons & PSP_CTRL_SELECT){
printf("Select pressed \n");
}
if (pad.Buttons & PSP_CTRL_LTRIGGER){
printf("L-trigger pressed \n");
}
if (pad.Buttons & PSP_CTRL_RTRIGGER){
printf("R-trigger pressed \n");
}
}
}
sceKernelExitGame();
return 0;
}
Code: Select all
TARGET = testprogram
OBJS = main.o
PSPSDK = $(shell psp-config --pspsdk-path)
PSPDEV = $(shell psp-config -d)
PSPBIN = $(PSPDEV)/bin
SDL_CONFIG = $(PSPBIN)/sdl-config
CFLAGS = -O2 -G0 -Wall -D PSP
CFLAGS += $(shell $(SDL_CONFIG) --cflags)
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBS = -lstdc++ -lSDL_ttf -lfreetype -lSDL_image -ljpeg -lpng -lz -lm -lSDL_mixer -lvorbisidec -lmikmod -lmad $(shell $(SDL_CONFIG) --libs)
LIBS += -lpspaudiolib -lpspaudio -lpsppower
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = TestProgram
include $(PSPSDK)/lib/build.mak