forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

C++ + SDL + TinyXML

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
sionlord



Joined: 09 Mar 2010
Posts: 10

PostPosted: Mon May 03, 2010 10:29 pm    Post subject: C++ + SDL + TinyXML Reply with quote

Hi again, sorry for the new post, i started it because it's a new problem on a slightly different topic, I hope the is no problem.

We're a group of three students porting our an SDL + C++ game for PC called Granny's Bloodbath (http://grannysbloodbath.wordpress.com/) for our University subject Games Design. I hope you like the idea.

I've downloaded the PSPSDK and the SDL libraries (with their auxiliaries ttf, mixer and image). I've managed to compile the XML parser for C++ and a sample project using SDL for C. The problem is that "SDL" + "C++" + "TinyXML" project doesn't seem to compile.

This is our makefile:

Code:
TARGET = Sdl_Example

PSPSDK = $(shell psp-config --pspsdk-path)

PSPBIN = $(shell psp-config --psp-prefix)/bin

SDL_CONFIG = $(PSPBIN)/sdl-config

OBJS =   main.o tinystr.o tinyxmlerror.o tinyxml.o tinyxmlparser.o


INCDIR =
CFLAGS = $(shell $(SDL_CONFIG) --cflags) -G0 -Wall -O2 -DPSP
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS =
LIBS = -lstdc++ -lsupc++ -lSDL_gfx -lSDL_image -lSDL_mixer -lSDL_ttf -lvorbisidec \

   -lfreetype -lpng -ljpeg -lz -lm $(shell $(SDL_CONFIG) --libs)




EXTRA_TARGETS = EBOOT.PBP



include $(PSPSDK)/lib/build.mak


And this is our error:

Code:
david@siondream:/media/Datos/sdl_mak_psp$ make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -I/usr/local/pspdev/psp/include/SDL -Dmain=SDL_main -G0 -Wall -O2 -DPSP -D_PSP_FW_VERSION=150  -L. -L/usr/local/pspdev/psp/sdk/lib   main.o tinystr.o tinyxmlerror.o tinyxml.o tinyxmlparser.o -lstdc++ -lsupc++ -lSDL_gfx -lSDL_image -lSDL_mixer -lSDL_ttf -lvorbisidec -lfreetype -lpng -ljpeg -lz -lm -L/usr/local/pspdev/psp/lib -lSDLmain -lSDL -lm -lGL -lpspvfpu -L/usr/local/pspdev/psp/sdk/lib -lpspdebug -lpspgu -lpspctrl -lpspge -lpspdisplay -lpsphprm -lpspsdk -lpsprtc -lpspaudio -lc -lpspuser -lpsputility -lpspkernel -lpspnet_inet -lpspirkeyb -lpsppower -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o Sdl_Example.elf
/usr/local/pspdev/psp/lib/libSDLmain.a(SDL_psp_main.o): En la función `main':
psp/SDL_psp_main.c:86: referencia a `SDL_main' sin definir
collect2: ld devolvió el estado de salida 1
make: *** [Sdl_Example.elf] Error 1


We've looked everywhere (forums, Google) without results. The comunity here is treating us so well, so we're really grateful. Sorry for any possible misspelling (we aren't English).

Thanks.
Back to top
View user's profile Send private message
Draan



Joined: 17 Oct 2009
Posts: 55

PostPosted: Mon May 03, 2010 11:12 pm    Post subject: Reply with quote

I had the same problem. Something like this worked for me
Code:

extern "C" SDL_main;

SDL_main()
{
     //It's our main function
}
Back to top
View user's profile Send private message
sionlord



Joined: 09 Mar 2010
Posts: 10

PostPosted: Mon May 03, 2010 11:27 pm    Post subject: Reply with quote

Now I get this error:

Code:
main.cpp:117: error: expected constructor, destructor, or type conversion before ‘;’ token


It talks about this line:

Code:
extern "C" SDL_main;


EDIT:

It would be JUST GREAT if someone could post a mini SDL + C++ project (code + makefile) that actually works. It would be useful for me and for anyone with the same problem. And I could trully know what I'm doing wrong.
Back to top
View user's profile Send private message
Draan



Joined: 17 Oct 2009
Posts: 55

PostPosted: Mon May 03, 2010 11:48 pm    Post subject: Reply with quote

Ah sorry, my fault, I've looked into my old srcs now.
It should be that:
Code:

extern "C" int SDL_main (int argc, char* args[]);

int main(int argc, char *args[])
{
   //our code
}


Should work finally :).
Back to top
View user's profile Send private message
sionlord



Joined: 09 Mar 2010
Posts: 10

PostPosted: Tue May 04, 2010 12:02 am    Post subject: Reply with quote

Ok, now I think we're getting deep into the problem, I hope we can solve it.

My error output looks like:

Code:
david@siondream:/media/Datos/sdl_mak_psp$ make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150  -L. -L/usr/local/pspdev/psp/sdk/lib   main.o tinystr.o tinyxmlerror.o tinyxml.o tinyxmlparser.o -lstdc++ -lSDLmain -lSDL_image -lSDL_mixer -lpng -ljpeg -lz -lSDL_ttf -lfreetype -lSDL_gfx -lm -lSDL -lpspvfpu -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 ejemplo.elf
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL_mixer.a(music_ogg.o): En la función `OGG_jump_to_time':
/home/david/PSPSDK/SDL_mixer/music_ogg.c:245: referencia a `ov_time_seek' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL_mixer.a(music_ogg.o): En la función `OGG_delete':
/home/david/PSPSDK/SDL_mixer/music_ogg.c:237: referencia a `ov_clear' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL_mixer.a(music_ogg.o): En la función `OGG_getsome':
/home/david/PSPSDK/SDL_mixer/music_ogg.c:159: referencia a `ov_read' sin definir
/home/david/PSPSDK/SDL_mixer/music_ogg.c:173: referencia a `ov_info' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL_mixer.a(music_ogg.o): En la función `OGG_new_RW':
/home/david/PSPSDK/SDL_mixer/music_ogg.c:126: referencia a `ov_open_callbacks' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL_mixer.a(music_ogg.o): En la función `OGG_new':
/home/david/PSPSDK/SDL_mixer/music_ogg.c:74: referencia a `ov_open' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL_mixer.a(load_ogg.o): En la función `Mix_LoadOGG_RW':
/home/david/PSPSDK/SDL_mixer/load_ogg.c:93: referencia a `ov_open_callbacks' sin definir
/home/david/PSPSDK/SDL_mixer/load_ogg.c:101: referencia a `ov_info' sin definir
/home/david/PSPSDK/SDL_mixer/load_ogg.c:112: referencia a `ov_pcm_total' sin definir
/home/david/PSPSDK/SDL_mixer/load_ogg.c:122: referencia a `ov_read' sin definir
/home/david/PSPSDK/SDL_mixer/load_ogg.c:140: referencia a `ov_clear' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o): En la función `PSP_GL_Init':
/home/david/PSPSDK/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:109: referencia a `eglGetDisplay' sin definir
/home/david/PSPSDK/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:109: referencia a `eglGetError' sin definir
/home/david/PSPSDK/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:110: referencia a `eglInitialize' sin definir
/home/david/PSPSDK/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:110: referencia a `eglGetError' sin definir
/home/david/PSPSDK/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:135: referencia a `eglChooseConfig' sin definir
/home/david/PSPSDK/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:135: referencia a `eglGetError' sin definir
/home/david/PSPSDK/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:143: referencia a `eglCreateContext' sin definir
/home/david/PSPSDK/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:143: referencia a `eglGetError' sin definir
/home/david/PSPSDK/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:144: referencia a `eglCreateWindowSurface' sin definir
/home/david/PSPSDK/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:144: referencia a `eglGetError' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o): En la función `PSP_GL_SwapBuffers':
/home/david/PSPSDK/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:82: referencia a `eglSwapBuffers' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o): En la función `PSP_GL_MakeCurrent':
/home/david/PSPSDK/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:69: referencia a `eglMakeCurrent' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x4): referencia a `glBegin' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0xc): referencia a `glBindTexture' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x14): referencia a `glBlendFunc' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x1c): referencia a `glColor4f' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x2c): referencia a `glDisable' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x34): referencia a `glEnable' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x3c): referencia a `glEnd' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x44): referencia a `glFlush' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x4c): referencia a `glGenTextures' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x54): referencia a `glGetString' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x5c): referencia a `glLoadIdentity' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x64): referencia a `glMatrixMode' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x6c): referencia a `glOrtho' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x74): referencia a `glPixelStorei' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x7c): referencia a `glPopAttrib' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x84): referencia a `glPopClientAttrib' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x8c): referencia a `glPopMatrix' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x94): referencia a `glPushAttrib' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x9c): referencia a `glPushClientAttrib' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0xa4): referencia a `glPushMatrix' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0xac): referencia a `glTexCoord2f' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0xb4): referencia a `glTexEnvf' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0xbc): referencia a `glTexImage2D' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0xc4): referencia a `glTexParameteri' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0xcc): referencia a `glTexSubImage2D' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0xd4): referencia a `glVertex2i' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0xdc): referencia a `glViewport' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspevents.o): En la función `PSP_EventQuit':
/home/david/PSPSDK/psplibraries/build/SDL/src/video/psp/SDL_pspevents.c:274: referencia a `pspIrKeybFinish' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspevents.o): En la función `PSP_EventInit':
/home/david/PSPSDK/psplibraries/build/SDL/src/video/psp/SDL_pspevents.c:247: referencia a `pspIrKeybInit' sin definir
/home/david/PSPSDK/psplibraries/build/SDL/src/video/psp/SDL_pspevents.c:249: referencia a `pspIrKeybOutputMode' sin definir
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libSDL.a(SDL_pspevents.o): En la función `PSP_PumpEvents':
/home/david/PSPSDK/psplibraries/build/SDL/src/video/psp/SDL_pspevents.c:112: referencia a `pspIrKeybReadinput' sin definir
collect2: ld devolvió el estado de salida 1
make: *** [ejemplo.elf] Error 1


So I think there is some kind of problem with some PSP library and SDL_Mixer (ogg). What's wrong?
Back to top
View user's profile Send private message
iceman755



Joined: 21 Jul 2008
Posts: 34

PostPosted: Tue May 04, 2010 2:04 am    Post subject: Reply with quote

I think you aren't linking all the libs that you need to.

Right now out of my head:

For pspgl errors:
-lGLUT -lGLU -lGL

For ogg:
-logg -lvorbisidec -lvorbis

And I think you need this one too:
-lSDL
_________________
"Libera eas de ore leonis, ne absorbeat eas tartarus, ne cadant in obscurum"
Back to top
View user's profile Send private message
sionlord



Joined: 09 Mar 2010
Posts: 10

PostPosted: Wed May 05, 2010 2:11 am    Post subject: Reply with quote

That's allright, thank you very much.

At least we're doing the PSP port, you can check it out on our blog!!!!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group