Now when I try to compile:
Mind you for int main, I've tried SDL_main(etc) extern "c" SDL_main(etc) and about every combination of SDL_main and main.
Compiled with this makefile:#include <pspkernel.h>
#include <pspdebug.h>
#include "SDL/SDL.h"
#define printf pspDebugScreenPrintf
/* Define the module info section */
PSP_MODULE_INFO("template", 0, 1, 1);
/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
extern int main(int argc, char *argv[]);
int main(int argc, char *argv[])
{
pspDebugScreenInit();
SDL_Init(SDL_INIT_VIDEO);
SDL_Surface* image;
SDL_Surface* background;
image = SDL_LoadBMP("hello.bmp");
background = SDL_SetVideoMode(480,272,24,SDL_FULLSCREEN | SDL_DOUBLEBUF | SDL_HWSURFACE);
SDL_Rect offset;
offset.x = 0;
offset.y = 0;
SDL_BlitSurface(image,NULL,background,&offset);
pspDebugScreenPrintf("Hello World\n");
return 0;
}
Again trying anything that would work theres just a ton of things added in here:
I get the error:TARGET = Ohaspii
OBJS = main.o
PSPSDK = $(shell psp-config --pspsdk-path)
PSPDEV = $(shell psp-config -d)
PSPBIN = $(PSPDEV)/bin
SDL_CONFIG = /usr/local/pspdev/psp/bin/sdl-config
CFLAGS = -O2 -G0 -Wall -D PSP
CFLAGS += $(shell $(SDL_CONFIG) --cflags)$(shell $(SDL_CONFIG) --cflags)
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBS= -lSDL -lSDL_ttf -lSDL_image -lpspirkeyb -lpspwlan -lpsppower -lGL -l freetype -ljpeg -lpng -lz -lm -lSDL -lpspgu -l psphprm -lpspaudio -lstdc++ -lpspvfpu -lpsprtc -lpspge
LIBS += -lpspaudiolib -lpspaudio -lpsppower
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Ohaspii
include $(PSPSDK)/lib/build.mak
I searched around for the answer to the problem but there were very few results and the few that I did find didn't help./usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/crt0.o: In function `_main':
/home/arkanoid/tmp/toolchain/psptoolchain/build/pspsdk/src/startup/crt0.c:86: undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [Ohaspii.elf] Error 1
I'm trying to write this in c++. I know that there are better things to be using than SDL. I'm only doing this because I happen to be learning SDL for other things and thought it would be interesting to compile somethings on the PSP. I'm not too familiar with Linux but I would really appreciate it if someone could help me get this compiled.
For what its worth, heres my bashrc environments I added:
There were also about 4 sdl-configs found on my computer in:export PSPDEV="/usr/local/pspdev"
export PSPSDK="/usr/local/pspdev/psp/sdk"
export PATH="$PATH:/usr/local/pspdev/bin:/usr/local/pspdev/psp/bin"
/usr/bin/
/usr/local/pspdev/bin
/usr/local/pspdev/psp/bin
And when I would sdl-config --prefix it would link to the one in /usr/bin/ so I renamed that one sdl-config2 so that it would read the one in /usr/local/pspdev/bin. The error I have happened before I did this, just thought I'd mention everything I can to pinpoint the problem.