| View previous topic :: View next topic |
| Author |
Message |
Nimue
Joined: 19 Oct 2008 Posts: 5
|
Posted: Sun Oct 19, 2008 5:08 pm Post subject: Questions on porting SDL apps |
|
|
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 |
|
 |
Wally

Joined: 26 Sep 2005 Posts: 672
|
Posted: Mon Oct 20, 2008 7:04 pm Post subject: Re: Questions on porting SDL apps |
|
|
| 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 |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Tue Oct 21, 2008 6:43 am Post subject: |
|
|
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 |
|
 |
Nimue
Joined: 19 Oct 2008 Posts: 5
|
Posted: Fri Oct 24, 2008 11:30 am Post subject: |
|
|
| 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 |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Fri Oct 24, 2008 2:28 pm Post subject: |
|
|
| -lc |
|
| Back to top |
|
 |
Nimue
Joined: 19 Oct 2008 Posts: 5
|
Posted: Sat Oct 25, 2008 1:21 am Post subject: |
|
|
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 |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Sat Oct 25, 2008 4:40 am Post subject: |
|
|
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 |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Sat Oct 25, 2008 7:26 am Post subject: |
|
|
| 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 |
|
 |
Nimue
Joined: 19 Oct 2008 Posts: 5
|
Posted: Sun Oct 26, 2008 3:12 pm Post subject: |
|
|
| 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 |
|
 |
Onii
Joined: 05 Oct 2008 Posts: 40
|
Posted: Sun Oct 26, 2008 5:01 pm Post subject: |
|
|
| I think you need -lSDL_main. |
|
| Back to top |
|
 |
Nimue
Joined: 19 Oct 2008 Posts: 5
|
Posted: Sun Oct 26, 2008 5:56 pm Post subject: |
|
|
| Onii wrote: | | I think you need -lSDL_main. |
Couldn't seem to find it. |
|
| Back to top |
|
 |
Wally

Joined: 26 Sep 2005 Posts: 672
|
Posted: Sun Oct 26, 2008 6:11 pm Post subject: |
|
|
| 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 |
|
 |
|