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 

Questions on porting SDL apps

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



Joined: 19 Oct 2008
Posts: 5

PostPosted: Sun Oct 19, 2008 5:08 pm    Post subject: Questions on porting SDL apps Reply with quote

I found the one guide to porting SDL apps using rRootage as an example, however I would like any others available. With some simple ones I've received and attempted to port I've had... Issues. If possible I'd like a general tutorial on writing or modifying the Makefile for porting SDL apps. Impossible to be a catch-all of course, but any tips would be appreciated.

http://i.1asphost.com/Nimue1016/dungeonmaker-2.05.7z

That's the code (slightly modified) with the Makefile I'm using.

I get these errors:


Code:

/tmp/cckBJFNY.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
/usr/local/pspdev/lib/gcc/psp/4.3.1/libgcc.a(unwind-dw2.o): In function `uw_install_context_1':
../../../libgcc/../gcc/unwind-dw2.c:1505: undefined reference to `memcpy'
collect2: ld returned 1 exit status
make: *** [Template.elf] Error 1
Back to top
View user's profile Send private message
Wally



Joined: 26 Sep 2005
Posts: 672

PostPosted: Mon Oct 20, 2008 7:04 pm    Post subject: Re: Questions on porting SDL apps Reply with quote

Nimue wrote:
I found the one guide to porting SDL apps using rRootage as an example, however I would like any others available. With some simple ones I've received and attempted to port I've had... Issues. If possible I'd like a general tutorial on writing or modifying the Makefile for porting SDL apps. Impossible to be a catch-all of course, but any tips would be appreciated.

http://i.1asphost.com/Nimue1016/dungeonmaker-2.05.7z

That's the code (slightly modified) with the Makefile I'm using.

I get these errors:


Code:

/tmp/cckBJFNY.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
/usr/local/pspdev/lib/gcc/psp/4.3.1/libgcc.a(unwind-dw2.o): In function `uw_install_context_1':
../../../libgcc/../gcc/unwind-dw2.c:1505: undefined reference to `memcpy'
collect2: ld returned 1 exit status
make: *** [Template.elf] Error 1


You are missing string.h in your includes.

Wally
Back to top
View user's profile Send private message AIM Address
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Tue Oct 21, 2008 6:43 am    Post subject: Reply with quote

Looks more like they're missing libc than the include. The SDL libs have certain library requirements of their own on the PSP. Look at various PSP SDL projects to get an idea of what other libs to include in the makefile.

For example, here's the libs used with Jump 'n Bump -

Code:
LIBS += $(shell $(PSPBIN)/freetype-config --libs)

LIBS += -lSDL_mixer -lvorbisfile -lvorbis -logg

LIBS += -L/usr/local/pspdev/psp/lib -lSDL -lpspirkeyb -lGL -lm -lpspvfpu -L/usr/local/pspdev/psp/sdk/lib -lpspdebug -lpspgu -lpspctrl -lpspge -lpspdisplay -lpsphprm -lpspsdk -lpsprtc -lpspaudio -lc -lpspuser -lpsputility -lpspkernel -lpspnet_inet -lpsppower

LIBS += -lSDL_ttf -lfreetype

LIBS += -lpng -ljpeg -lz -lm -lpsppower -lmad -lpspaudio -lpspaudiolib

Back to top
View user's profile Send private message AIM Address
Nimue



Joined: 19 Oct 2008
Posts: 5

PostPosted: Fri Oct 24, 2008 11:30 am    Post subject: Reply with quote

Well with string.h included I am still having the memcpy error. I have actually been getting this on one or two other things I've tried to port. Any suggestions?
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Fri Oct 24, 2008 2:28 pm    Post subject: Reply with quote

-lc
Back to top
View user's profile Send private message AIM Address
Nimue



Joined: 19 Oct 2008
Posts: 5

PostPosted: Sat Oct 25, 2008 1:21 am    Post subject: Reply with quote

J.F. wrote:
-lc


Still no luck and the same error. Even copying and pasting the LIBS section (and then taking out the parts I don't have support for that shouldn't matter [tiff, irkeyboard, etc]) you supplied doesn't seem to help any.

Download the file I supplied and then change the following things:

add #include<string.h> to the DungeonMaker.cpp file

Replace the Makefile with this:

Code:


TARGET = Template
OBJS = DungeonMaker.cpp

CC=gcc
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =

LIBS += -L/usr/local/pspdev/psp/lib -lSDL -lGL -lm -lpspvfpu -L/usr/local/pspdev/psp/sdk/lib -lpspdebug -lpspgu -lpspctrl -lpspge -lpspdisplay -lpsphprm -lpspsdk -lpsprtc -lpspaudio -lc -lpspuser -lpsputility -lpspkernel -lpspnet_inet -lpsppower

LIBS += -lpng -ljpeg -lz -lm -lpsppower -lmad -lpspaudio -lpspaudiolib
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Template

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak

Back to top
View user's profile Send private message
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Sat Oct 25, 2008 4:40 am    Post subject: Reply with quote

I download the archive you linked at the top.

This Makefile compiles the DungeonMaker.cpp file for me.

Code:
TARGET = Template
OBJS = DungeonMaker.o

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

LIBDIR =
LIBS = -lpspgu -lpng -lz -lm -lstdc++
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Template

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak


Note the subtle differences.
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sat Oct 25, 2008 7:26 am    Post subject: Reply with quote

AH!! It's a C++ project! No wonder -lc wasn't working. :) I wish people would specify C/C++ when asking about problems. Us devs know there's a difference, and it's so fundamental, we might not ask. It would be like asking "well, are you using a computer?" :D
Back to top
View user's profile Send private message AIM Address
Nimue



Joined: 19 Oct 2008
Posts: 5

PostPosted: Sun Oct 26, 2008 3:12 pm    Post subject: Reply with quote

J.F. wrote:
AH!! It's a C++ project! No wonder -lc wasn't working. :) I wish people would specify C/C++ when asking about problems. Us devs know there's a difference, and it's so fundamental, we might not ask. It would be like asking "well, are you using a computer?" :D


Eh... I know well enough that there's a rather fundamental difference... I've coded in both (mostly in C), I don't really know -lc, I just use a template Makefile for my varying projects (which have admittedly been rather simple file parsers and such. One short little text game I wrote in C++ as my first project back in like... High school. Also some limited image shit for course purposes down at GATech) I made awhile ago (about three years). I just figured you took a look at the link I posted and just followed what you said. I'm not really a serious developer. Just write what I need.

edit: I just caught that I had CC=gcc. Feel like an idiot there.

Still having issues though. There's a reason it's called a template =P. Used it on my other PSP projects (Again, nothing notable. Just... Displaying text and such).

Code:

/usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/crt0.o: In function `_main':
/usr/local/src/psptoolchain/build/pspsdk/src/startup/crt0.c:86: undefined reference to `main'
collect2: ld はステータス 1 で終了しました
make: *** [Template.elf] エラー 1
Back to top
View user's profile Send private message
Onii



Joined: 05 Oct 2008
Posts: 40

PostPosted: Sun Oct 26, 2008 5:01 pm    Post subject: Reply with quote

I think you need -lSDL_main.
Back to top
View user's profile Send private message
Nimue



Joined: 19 Oct 2008
Posts: 5

PostPosted: Sun Oct 26, 2008 5:56 pm    Post subject: Reply with quote

Onii wrote:
I think you need -lSDL_main.


Couldn't seem to find it.
Back to top
View user's profile Send private message
Wally



Joined: 26 Sep 2005
Posts: 672

PostPosted: Sun Oct 26, 2008 6:11 pm    Post subject: Reply with quote

Nimue wrote:
Onii wrote:
I think you need -lSDL_main.


Couldn't seem to find it.


you'll have to rename the main loop its more commonly known as main(arg c blah blah)

call it main() of course.

Wally
Back to top
View user's profile Send private message AIM Address
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