Problems with compiling my engine.

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
User avatar
Oguz286
Posts: 35
Joined: Tue Oct 30, 2007 4:56 am

Problems with compiling my engine.

Post by Oguz286 »

Hello everyone.

I've written a little 2d-engine using SDL and it's working fine. I'm trying to port it to the PSP, but i'm getting tons and tons of errors. I compiled psptoolchain, SDL, SDL_image and SDL_mixer without problems. I use Code::Blocks to compile it for the pc, but the IDE doesn't generate Makefiles so i have used the one found in the trunk/tests/SDL/ folder and modified it a bit. Here is what it looks like:

Code: Select all

TARGET = engine
OBJS = main.o globals/globals.o globals/Timer.o sound/Sound.o sound/SoundEffect.o sound/Music.o graphics/Texture.o graphics/StaticTexture.o graphics/Animation.o graphics/TextureManager.o 

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

LIBDIR =
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP kxploit
EXTRA_CLEAN = my-clean

PSP_EBOOT_TITLE = OguEngine
PSP_DIR_NAME = OguEngine
PSP_FW_VERSION = 371

PSPSDK=$(shell psp-config --pspsdk-path)
PSPBIN = $(PSPSDK)/../bin
CFLAGS += $(shell $(PSPBIN)/sdl-config --cflags)
LIBS += $(shell $(PSPBIN)/sdl-config --libs) -lSDL_image -lSDL_mixer
include $(PSPSDK)/lib/build.mak
It can just as well be a problem with the makefile, because i've never used them before. The errors i'm getting are:

Code: Select all

main.o: In function `SDL_main(int, char**)':
main.cpp&#58;&#40;.text+0xa0&#41;&#58; undefined reference to `std&#58;&#58;basic_string<char, std&#58;&#58;char_traits<char>, std&#58;&#58;allocator<char> >&#58;&#58;basic_string&#40;char const*, std&#58;&#58;allocator<char> const&&#41;'
main.cpp&#58;&#40;.text+0xcc&#41;&#58; undefined reference to `std&#58;&#58;basic_string<char, std&#58;&#58;char_traits<char>, std&#58;&#58;allocator<char> >&#58;&#58;_Rep&#58;&#58;_S_empty_rep_storage'
main.cpp&#58;&#40;.text+0xd4&#41;&#58; undefined reference to `std&#58;&#58;basic_string<char, std&#58;&#58;char_traits<char>, std&#58;&#58;allocator<char> >&#58;&#58;_Rep&#58;&#58;_S_empty_rep_storage'

Code: Select all

Music.cpp&#58;&#40;.text+0xfc&#41;&#58; undefined reference to `operator delete&#40;void*&#41;'

Code: Select all

/usr/local/pspdev/psp/lib/libSDL_image.a&#40;IMG_bmp.o&#41;&#58; In function `IMG_LoadBMP_RW'&#58;
/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;196&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;197&#58; undefined reference to `SDL_ReadLE16'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;198&#58; undefined reference to `SDL_ReadLE16'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;199&#58; undefined reference to `SDL_ReadLE32'

Code: Select all

/home/oguz/Downloads/ps2dev/SDL_mixer/load_aiff.c&#58;158&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/load_aiff.c&#58;159&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/load_aiff.c&#58;160&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/load_aiff.c&#58;161&#58; undefined reference to `SDL_ReadBE16'
/usr/local/pspdev/psp/lib/libSDL_mixer.a&#40;mix.o&#41;&#58; In function `update_tremolo'&#58;
/home/oguz/Downloads/ps2dev/SDL_mixer/timidity/mix.c&#58;188&#58; undefined reference to `sin'
/usr/local/pspdev/psp/lib/libSDL_mixer.a&#40;filter.o&#41;&#58; In function `designfir'&#58;
/home/oguz/Downloads/ps2dev/SDL_mixer/timidity/filter.c&#58;88&#58; undefined reference to `sin'
/home/oguz/Downloads/ps2dev/SDL_mixer/timidity/filter.c&#58;92&#58; undefined reference to `log'
/home/oguz/Downloads/ps2dev/SDL_mixer/timidity/filter.c&#58;92&#58; undefined reference to `exp'
/usr/local/pspdev/psp/lib/libSDL_mixer.a&#40;filter.o&#41;&#58; In function `kaiser'&#58;
/home/oguz/Downloads/ps2dev/SDL_mixer/timidity/filter.c&#58;70&#58; undefined reference to `sqrt'
These are just a few of them of which i think are relevant. It's C++ code but psp-gcc is used (i don't know why). And i see references to my downloads folder where i stored the stuff from the ps2dev SVN. I'm really confused, i hope someone can guide me in the right way.
CpuWhiz
Posts: 42
Joined: Mon Jun 04, 2007 1:30 am

Re: Problems with compiling my engine.

Post by CpuWhiz »

Oguz286 wrote:

Code: Select all

Music.cpp&#58;&#40;.text+0xfc&#41;&#58; undefined reference to `operator delete&#40;void*&#41;'
-lstdc++
Oguz286 wrote:

Code: Select all

/home/oguz/Downloads/ps2dev/SDL_mixer/timidity/filter.c&#58;88&#58; undefined reference to `sin'
-lm

Some of the others will go away when you add these. Not so sure on the SDL_Read ones though. Check the output of sdl-config is good? Maybe shuffle the order around some? It should have added -lm because my sdl-config is showing the following:

Code: Select all

-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
User avatar
Oguz286
Posts: 35
Joined: Tue Oct 30, 2007 4:56 am

Re: Problems with compiling my engine.

Post by Oguz286 »

CpuWhiz wrote:
Oguz286 wrote:

Code: Select all

Music.cpp&#58;&#40;.text+0xfc&#41;&#58; undefined reference to `operator delete&#40;void*&#41;'
-lstdc++
Oguz286 wrote:

Code: Select all

/home/oguz/Downloads/ps2dev/SDL_mixer/timidity/filter.c&#58;88&#58; undefined reference to `sin'
-lm

Some of the others will go away when you add these. Not so sure on the SDL_Read ones though. Check the output of sdl-config is good? Maybe shuffle the order around some? It should have added -lm because my sdl-config is showing the following:

Code: Select all

-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
Thanks for the reply!

-lstdc++ helped clear away the mayority of the errors. But i still think it should use the psp-g++ compiler instead.

-lm didn't solve anything unfortunately.

The errors now are:

Code: Select all

/usr/local/pspdev/psp/lib/libSDLmain.a&#40;SDL_psp_main.o&#41;&#58; In function `main'&#58;
psp/SDL_psp_main.c&#58;178&#58; undefined reference to `SDL_main'
/usr/local/pspdev/psp/lib/libSDL_image.a&#40;IMG_bmp.o&#41;&#58; In function `IMG_LoadBMP_RW'&#58;
/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;196&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;197&#58; undefined reference to `SDL_ReadLE16'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;198&#58; undefined reference to `SDL_ReadLE16'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;199&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;202&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;215&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;216&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;217&#58; undefined reference to `SDL_ReadLE16'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;218&#58; undefined reference to `SDL_ReadLE16'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;219&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;220&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;221&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;222&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;223&#58; undefined reference to `SDL_ReadLE32'
/usr/local/pspdev/psp/lib/libSDL_image.a&#40;IMG_bmp.o&#41;&#58;/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;224&#58; more undefined references to `SDL_ReadLE32' follow
/usr/local/pspdev/psp/lib/libSDL_image.a&#40;IMG_bmp.o&#41;&#58; In function `IMG_LoadBMP_RW'&#58;
/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;204&#58; undefined reference to `SDL_ReadLE16'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;205&#58; undefined reference to `SDL_ReadLE16'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;206&#58; undefined reference to `SDL_ReadLE16'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_bmp.c&#58;207&#58; undefined reference to `SDL_ReadLE16'
/usr/local/pspdev/psp/lib/libSDL_image.a&#40;IMG_jpg.o&#41;&#58; In function `IMG_LoadJPG_RW'&#58;
/home/oguz/Downloads/ps2dev/SDL_image/IMG_jpg.c&#58;206&#58; undefined reference to `jpeg_std_error'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_jpg.c&#58;217&#58; undefined reference to `jpeg_CreateDecompress'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_jpg.c&#58;169&#58; undefined reference to `jpeg_resync_to_restart'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_jpg.c&#58;169&#58; undefined reference to `jpeg_resync_to_restart'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_jpg.c&#58;219&#58; undefined reference to `jpeg_read_header'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_jpg.c&#58;230&#58; undefined reference to `jpeg_calc_output_dimensions'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_jpg.c&#58;247&#58; undefined reference to `jpeg_start_decompress'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_jpg.c&#58;251&#58; undefined reference to `jpeg_read_scanlines'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_jpg.c&#58;253&#58; undefined reference to `jpeg_finish_decompress'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_jpg.c&#58;257&#58; undefined reference to `jpeg_destroy_decompress'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_jpg.c&#58;211&#58; undefined reference to `jpeg_destroy_decompress'
/usr/local/pspdev/psp/lib/libSDL_image.a&#40;IMG_png.o&#41;&#58; In function `IMG_LoadPNG_RW'&#58;
/home/oguz/Downloads/ps2dev/SDL_image/IMG_png.c&#58;123&#58; undefined reference to `png_create_read_struct'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_png.c&#58;131&#58; undefined reference to `png_create_info_struct'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_png.c&#58;281&#58; undefined reference to `png_destroy_read_struct'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_png.c&#58;147&#58; undefined reference to `png_set_read_fn'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_png.c&#58;150&#58; undefined reference to `png_read_info'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_png.c&#58;151&#58; undefined reference to `png_get_IHDR'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_png.c&#58;155&#58; undefined reference to `png_set_strip_16'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_png.c&#58;160&#58; undefined reference to `png_set_packing'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_png.c&#58;169&#58; undefined reference to `png_get_valid'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_png.c&#58;198&#58; undefined reference to `png_read_update_info'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_png.c&#58;200&#58; undefined reference to `png_get_IHDR'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_png.c&#58;250&#58; undefined reference to `png_read_image'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_png.c&#58;172&#58; undefined reference to `png_get_tRNS'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_png.c&#58;164&#58; undefined reference to `png_set_expand'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_png.c&#58;196&#58; undefined reference to `png_set_gray_to_rgb'
/home/oguz/Downloads/ps2dev/SDL_image/IMG_png.c&#58;189&#58; undefined reference to `png_set_expand'
/usr/local/pspdev/psp/lib/libSDL_image.a&#40;IMG_png.o&#41;&#58; In function `png_read_data'&#58;
/home/oguz/Downloads/ps2dev/SDL_image/IMG_png.c&#58;94&#58; undefined reference to `png_get_io_ptr'
/usr/local/pspdev/psp/lib/libSDL_image.a&#40;IMG_png.o&#41;&#58; In function `IMG_isPNG'&#58;
/home/oguz/Downloads/ps2dev/SDL_image/IMG_png.c&#58;86&#58; undefined reference to `png_sig_cmp'
/usr/local/pspdev/psp/lib/libSDL_mixer.a&#40;mixer.o&#41;&#58; In function `Mix_LoadWAV_RW'&#58;
/home/oguz/Downloads/ps2dev/SDL_mixer/mixer.c&#58;426&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/mixer.c&#58;482&#58; undefined reference to `SDL_FreeWAV'
/home/oguz/Downloads/ps2dev/SDL_mixer/mixer.c&#58;433&#58; undefined reference to `SDL_LoadWAV_RW'
/home/oguz/Downloads/ps2dev/SDL_mixer/mixer.c&#58;477&#58; undefined reference to `SDL_FreeWAV'
/usr/local/pspdev/psp/lib/libSDL_mixer.a&#40;mixer.o&#41;&#58; In function `mix_channels'&#58;
/home/oguz/Downloads/ps2dev/SDL_mixer/mixer.c&#58;207&#58; undefined reference to `SDL_MixAudio'
/home/oguz/Downloads/ps2dev/SDL_mixer/mixer.c&#58;231&#58; undefined reference to `SDL_MixAudio'
/usr/local/pspdev/psp/lib/libSDL_mixer.a&#40;wavestream.o&#41;&#58; In function `WAVStream_PlaySome'&#58;
/home/oguz/Downloads/ps2dev/SDL_mixer/wavestream.c&#58;196&#58; undefined reference to `SDL_MixAudio'
/usr/local/pspdev/psp/lib/libSDL_mixer.a&#40;wavestream.o&#41;&#58; In function `ReadChunk'&#58;
/home/oguz/Downloads/ps2dev/SDL_mixer/wavestream.c&#58;241&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/wavestream.c&#58;242&#58; undefined reference to `SDL_ReadLE32'
/usr/local/pspdev/psp/lib/libSDL_mixer.a&#40;wavestream.o&#41;&#58; In function `WAVStream_LoadSong'&#58;
/home/oguz/Downloads/ps2dev/SDL_mixer/wavestream.c&#58;290&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/wavestream.c&#58;291&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/wavestream.c&#58;292&#58; undefined reference to `SDL_ReadLE32'
/usr/local/pspdev/psp/lib/libSDL_mixer.a&#40;wavestream.o&#41;&#58;/home/oguz/Downloads/ps2dev/SDL_mixer/wavestream.c&#58;441&#58; more undefined references to `SDL_ReadLE32' follow
/usr/local/pspdev/psp/lib/libSDL_mixer.a&#40;wavestream.o&#41;&#58; In function `WAVStream_LoadSong'&#58;
/home/oguz/Downloads/ps2dev/SDL_mixer/wavestream.c&#58;442&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/wavestream.c&#58;443&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/wavestream.c&#58;461&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/wavestream.c&#58;462&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/wavestream.c&#58;472&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/wavestream.c&#58;473&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/wavestream.c&#58;481&#58; undefined reference to `SDL_ReadBE16'
/home/oguz/Downloads/ps2dev/SDL_mixer/wavestream.c&#58;482&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/wavestream.c&#58;483&#58; undefined reference to `SDL_ReadBE16'
/usr/local/pspdev/psp/lib/libSDL_mixer.a&#40;instrum.o&#41;&#58; In function `load_instrument'&#58;
/home/oguz/Downloads/ps2dev/SDL_mixer/timidity/instrum.c&#58;524&#58; undefined reference to `pow'
/usr/local/pspdev/psp/lib/libSDL_mixer.a&#40;resample.o&#41;&#58; In function `update_vibrato'&#58;
/home/oguz/Downloads/ps2dev/SDL_mixer/timidity/resample.c&#58;349&#58; undefined reference to `sin'
/usr/local/pspdev/psp/lib/libSDL_mixer.a&#40;load_aiff.o&#41;&#58; In function `Mix_LoadAIFF_RW'&#58;
/home/oguz/Downloads/ps2dev/SDL_mixer/load_aiff.c&#58;104&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/load_aiff.c&#58;105&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/load_aiff.c&#58;111&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/load_aiff.c&#58;127&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/load_aiff.c&#58;128&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/load_aiff.c&#58;144&#58; undefined reference to `SDL_ReadBE16'
/home/oguz/Downloads/ps2dev/SDL_mixer/load_aiff.c&#58;145&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/load_aiff.c&#58;146&#58; undefined reference to `SDL_ReadBE16'
/home/oguz/Downloads/ps2dev/SDL_mixer/load_aiff.c&#58;137&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/load_aiff.c&#58;138&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/load_aiff.c&#58;158&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/load_aiff.c&#58;159&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/load_aiff.c&#58;160&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Downloads/ps2dev/SDL_mixer/load_aiff.c&#58;161&#58; undefined reference to `SDL_ReadBE16'
/usr/local/pspdev/psp/lib/libSDL_mixer.a&#40;mix.o&#41;&#58; In function `update_tremolo'&#58;
/home/oguz/Downloads/ps2dev/SDL_mixer/timidity/mix.c&#58;188&#58; undefined reference to `sin'
/usr/local/pspdev/psp/lib/libSDL_mixer.a&#40;filter.o&#41;&#58; In function `designfir'&#58;
/home/oguz/Downloads/ps2dev/SDL_mixer/timidity/filter.c&#58;88&#58; undefined reference to `sin'
/home/oguz/Downloads/ps2dev/SDL_mixer/timidity/filter.c&#58;92&#58; undefined reference to `log'
/home/oguz/Downloads/ps2dev/SDL_mixer/timidity/filter.c&#58;92&#58; undefined reference to `exp'
/usr/local/pspdev/psp/lib/libSDL_mixer.a&#40;filter.o&#41;&#58; In function `kaiser'&#58;
/home/oguz/Downloads/ps2dev/SDL_mixer/timidity/filter.c&#58;70&#58; undefined reference to `sqrt'
collect2&#58; ld returned 1 exit status
make&#58; *** &#91;engine.elf&#93; Error 1
sdl-config --libs gives this:

Code: Select all

-L/usr/lib -lSDL
which i think is wrong. It should point to the pspdev lib afaik. Any idea what it could be? Thanks for the help so far!
danzel
Posts: 182
Joined: Fri Nov 04, 2005 11:03 pm

Post by danzel »

sdl-config doesn't work on the psp.

My messy libs look like this:

Code: Select all

LIBS= -lSDL_image -lSDL_mixer -lSDL -lGLU -lGL  -lpng -ljpeg -lz -lm -lstdc++ -lc -lc -lpsputility -lpspdebug -lpspgu -lpspge -lpspdisplay -lpspctrl -lpspvfpu -lpspuser -lpsprtc -lpsppower -lpspdebug -lpspge -lpspaudio -lpspctrl -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpsphprm -lpspsdk
So, try something like it ;-) The first bit should be all you need.
User avatar
Oguz286
Posts: 35
Joined: Tue Oct 30, 2007 4:56 am

Post by Oguz286 »

danzel wrote:sdl-config doesn't work on the psp.

My messy libs look like this:

Code: Select all

LIBS= -lSDL_image -lSDL_mixer -lSDL -lGLU -lGL  -lpng -ljpeg -lz -lm -lstdc++ -lc -lc -lpsputility -lpspdebug -lpspgu -lpspge -lpspdisplay -lpspctrl -lpspvfpu -lpspuser -lpsprtc -lpsppower -lpspdebug -lpspge -lpspaudio -lpspctrl -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpsphprm -lpspsdk
So, try something like it ;-) The first bit should be all you need.
Hmm i didn't know sdl-config didn't work. Anyway, my code almost compiled. I got an error "undefined reference to main" but i read somewhere on the forums that i must include 'extern "c"' so i did that, but it still doesn't compile (although i have a lot less errors!):

With extern "C":

Code: Select all

 make
psp-g++ -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I/usr/local/pspdev/psp/include/SDL -Dmain=SDL_main -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I/usr/local/pspdev/psp/include/SDL -Dmain=SDL_main -fno-exceptions -fno-rtti -D_PSP_FW_VERSION=371   -c -o main.o main.cpp
main.cpp&#58; In function &#8216;int SDL_main&#40;int, char**&#41;&#8217;&#58;
main.cpp&#58;81&#58; warning&#58; unused variable &#8216;musId0&#8217;
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I/usr/local/pspdev/psp/include/SDL -Dmain=SDL_main -D_PSP_FW_VERSION=371  -L. -L/usr/local/pspdev/psp/sdk/lib -specs=/usr/local/pspdev/psp/sdk/lib/prxspecs -Wl,-q,-T/usr/local/pspdev/psp/sdk/lib/linkfile.prx   main.o globals/globals.o globals/Timer.o sound/Sound.o sound/SoundEffect.o sound/Music.o graphics/Texture.o graphics/StaticTexture.o graphics/Animation.o graphics/TextureManager.o /usr/local/pspdev/psp/sdk/lib/prxexports.o -lSDL_image -lSDL_mixer -lSDL -lpng -ljpeg -lz -lm -lstdc++ -lc -lc -lpsputility -lpspdebug -lpspgu -lpspge -lpspdisplay -lpspctrl -lpspvfpu -lpspuser -lpsprtc -lpsppower -lpspdebug -lpspge -lpspaudio -lpspctrl -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpsphprm -lpspsdk -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o engine.elf
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/crt0_prx.o&#58; In function `_main'&#58;
/home/oguz/Downloads/ps2dev/psptoolchain/build/pspsdk/src/startup/crt0_prx.c&#58;91&#58; undefined reference to `main'
/usr/local/pspdev/psp/sdk/lib/prxexports.o&#58;&#40;.rodata.sceResident+0xc&#41;&#58; undefined reference to `module_info'
collect2&#58; ld returned 1 exit status
make&#58; *** &#91;engine.elf&#93; Error 1
Without extern "C":

Code: Select all

 make
psp-g++ -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I/usr/local/pspdev/psp/include/SDL -Dmain=SDL_main -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I/usr/local/pspdev/psp/include/SDL -Dmain=SDL_main -fno-exceptions -fno-rtti -D_PSP_FW_VERSION=371   -c -o main.o main.cpp
main.cpp&#58; In function &#8216;int SDL_main&#40;int, char**&#41;&#8217;&#58;
main.cpp&#58;81&#58; warning&#58; unused variable &#8216;musId0&#8217;
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I/usr/local/pspdev/psp/include/SDL -Dmain=SDL_main -D_PSP_FW_VERSION=371  -L. -L/usr/local/pspdev/psp/sdk/lib -specs=/usr/local/pspdev/psp/sdk/lib/prxspecs -Wl,-q,-T/usr/local/pspdev/psp/sdk/lib/linkfile.prx   main.o globals/globals.o globals/Timer.o sound/Sound.o sound/SoundEffect.o sound/Music.o graphics/Texture.o graphics/StaticTexture.o graphics/Animation.o graphics/TextureManager.o /usr/local/pspdev/psp/sdk/lib/prxexports.o -lSDL_image -lSDL_mixer -lSDL -lpng -ljpeg -lz -lm -lstdc++ -lc -lc -lpsputility -lpspdebug -lpspgu -lpspge -lpspdisplay -lpspctrl -lpspvfpu -lpspuser -lpsprtc -lpsppower -lpspdebug -lpspge -lpspaudio -lpspctrl -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpsphprm -lpspsdk -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o engine.elf
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/crt0_prx.o&#58; In function `_main'&#58;
/home/oguz/Downloads/ps2dev/psptoolchain/build/pspsdk/src/startup/crt0_prx.c&#58;91&#58; undefined reference to `main'
/usr/local/pspdev/psp/sdk/lib/prxexports.o&#58;&#40;.rodata.sceResident+0xc&#41;&#58; undefined reference to `module_info'
collect2&#58; ld returned 1 exit status
make&#58; *** &#91;engine.elf&#93; Error 1
As you can see, the errors are the same, so that didn't work. The documentation of SDL for the psp tells me that i should write my app just like any other app and SDL_main will take care of the callbacks and stuff like that for me. So here's the beginning of my main.cpp:

Code: Select all

#include "./globals/globals.h"

//extern "C"
int main &#40; int argc, char** argv &#41;
&#123;
    // initialize SDL video
    if &#40; SDL_Init&#40; SDL_INIT_EVERYTHING &#41; < 0 &#41;
    &#123;
        printf&#40; "Unable to init SDL&#58; %s\n", SDL_GetError&#40;&#41; &#41;;
        return 1;
    &#125;

	if&#40;Mix_OpenAudio&#40;22050, MIX_DEFAULT_FORMAT, 2, 4096&#41; == -1&#41; &#123;
		printf&#40;"Unable to init audio.\n"&#41;;
		return 1;
	&#125;

    // make sure SDL cleans up before exit
    atexit&#40;SDL_Quit&#41;;

    // create a new window
    SDL_Surface* screen = SDL_SetVideoMode&#40;640, 480, 16,
                                           SDL_HWSURFACE|SDL_DOUBLEBUF&#41;;
    if &#40; !screen &#41;
    &#123;
        printf&#40;"Unable to set 640x480 video&#58; %s\n", SDL_GetError&#40;&#41;&#41;;
        return 1;
    &#125;
...
...
Thanks for the help, i really appreciate it! Btw, i'm using the search function to find similar problems but i always get the same result whatever the searchstring is. Am i doing something wrong here?
User avatar
Oguz286
Posts: 35
Joined: Tue Oct 30, 2007 4:56 am

Post by Oguz286 »

Allright, i started all over. I removed everything PSP related from laptop (i'm running ubuntu 7.10 btw) and followed these steps that J.F. explained so well to build a clean toolchain and libraries:

http://forums.ps2dev.org/viewtopic.php? ... s&start=30

Everthing compiled fine and i saw no errors (i outputted evertything to a log file and i searched the entire file for errors and there were none). So i should not have a problem with an unclean toolchain.

The makefile i'm using:

Code: Select all

TARGET = engine
OBJS = main.o globals/globals.o globals/Timer.o sound/Sound.o sound/SoundEffect.o sound/Music.o graphics/Texture.o graphics/StaticTexture.o graphics/Animation.o graphics/TextureManager.o 

INCDIR = 
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;

LIBDIR =
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP kxploit
EXTRA_CLEAN = my-clean

PSP_EBOOT_TITLE = OguEngine
PSP_DIR_NAME = OguEngine
BUILD_PRX = 1
PSP_FW_VERSION = 371

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
PSPBIN = $&#40;PSPSDK&#41;/../bin
CFLAGS += $&#40;shell $&#40;PSPBIN&#41;/sdl-config --cflags&#41;
LIBS= -lSDL_image -lSDL_mixer -lSDL -lGLU -lGL  -lpng -ljpeg -lz -lm -lstdc++ -lc -lpsputility -lpspdebug -lpspgu -lpspge -lpspdisplay -lpspctrl -lpspvfpu -lpspuser -lpsprtc -lpsppower -lpspdebug -lpspge -lpspaudio -lpspctrl -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpsphprm -lpspsdk
include $&#40;PSPSDK&#41;/lib/build.mak
And here is the output:

Code: Select all

make
psp-g++ -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I/usr/local/pspdev/psp/include/SDL -Dmain=SDL_main -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I/usr/local/pspdev/psp/include/SDL -Dmain=SDL_main -fno-exceptions -fno-rtti -D_PSP_FW_VERSION=371   -c -o main.o main.cpp
main.cpp&#58; In function &#8216;int SDL_main&#40;int, char**&#41;&#8217;&#58;
main.cpp&#58;81&#58; warning&#58; unused variable &#8216;musId0&#8217;
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I/usr/local/pspdev/psp/include/SDL -Dmain=SDL_main -D_PSP_FW_VERSION=371  -L. -L/usr/local/pspdev/psp/sdk/lib -specs=/usr/local/pspdev/psp/sdk/lib/prxspecs -Wl,-q,-T/usr/local/pspdev/psp/sdk/lib/linkfile.prx   main.o globals/globals.o globals/Timer.o sound/Sound.o sound/SoundEffect.o sound/Music.o graphics/Texture.o graphics/StaticTexture.o graphics/Animation.o graphics/TextureManager.o /usr/local/pspdev/psp/sdk/lib/prxexports.o -lSDL_image -lSDL_mixer -lSDL -lGLU -lGL  -lpng -ljpeg -lz -lm -lstdc++ -lc -lpsputility -lpspdebug -lpspgu -lpspge -lpspdisplay -lpspctrl -lpspvfpu -lpspuser -lpsprtc -lpsppower -lpspdebug -lpspge -lpspaudio -lpspctrl -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpsphprm -lpspsdk -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o engine.elf
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/crt0_prx.o&#58; In function `_main'&#58;
/home/oguz/Projects/PSP/devtools/psptoolchain/build/pspsdk/src/startup/crt0_prx.c&#58;91&#58; undefined reference to `main'
/usr/local/pspdev/psp/sdk/lib/prxexports.o&#58;&#40;.rodata.sceResident+0xc&#41;&#58; undefined reference to `module_info'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_internal_playing'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;1115&#58; undefined reference to `SMPEG_status'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_internal_halt'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;992&#58; undefined reference to `SMPEG_stop'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_internal_volume'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;924&#58; undefined reference to `SMPEG_setvolume'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_internal_position'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;841&#58; undefined reference to `SMPEG_skip'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;843&#58; undefined reference to `SMPEG_rewind'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;844&#58; undefined reference to `SMPEG_play'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_internal_play'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;750&#58; undefined reference to `SMPEG_enableaudio'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;751&#58; undefined reference to `SMPEG_enablevideo'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;752&#58; undefined reference to `SMPEG_play'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `Mix_FreeMusic'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;663&#58; undefined reference to `SMPEG_delete'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `Mix_LoadMUS'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;568&#58; undefined reference to `SMPEG_new'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;573&#58; undefined reference to `SMPEG_actualSpec'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_mixer'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;318&#58; undefined reference to `SMPEG_playAudio'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music_ogg.o&#41;&#58; In function `OGG_jump_to_time'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music_ogg.c&#58;245&#58; undefined reference to `ov_time_seek'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music_ogg.o&#41;&#58; In function `OGG_delete'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music_ogg.c&#58;237&#58; undefined reference to `ov_clear'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music_ogg.o&#41;&#58; In function `OGG_playAudio'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music_ogg.c&#58;159&#58; undefined reference to `ov_read'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music_ogg.c&#58;173&#58; undefined reference to `ov_info'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music_ogg.o&#41;&#58; In function `OGG_new_RW'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music_ogg.c&#58;126&#58; undefined reference to `ov_open_callbacks'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music_ogg.o&#41;&#58; In function `OGG_new'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music_ogg.c&#58;74&#58; undefined reference to `ov_open'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;load_ogg.o&#41;&#58; In function `Mix_LoadOGG_RW'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_ogg.c&#58;93&#58; undefined reference to `ov_open_callbacks'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_ogg.c&#58;101&#58; undefined reference to `ov_info'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_ogg.c&#58;112&#58; undefined reference to `ov_pcm_total'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_ogg.c&#58;122&#58; undefined reference to `ov_read'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_ogg.c&#58;128&#58; undefined reference to `ov_read'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_ogg.c&#58;140&#58; undefined reference to `ov_clear'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL.a&#40;SDL_pspevents.o&#41;&#58; In function `PSP_EventQuit'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL/src/video/psp/SDL_pspevents.c&#58;274&#58; undefined reference to `pspIrKeybFinish'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL.a&#40;SDL_pspevents.o&#41;&#58; In function `PSP_EventInit'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL/src/video/psp/SDL_pspevents.c&#58;247&#58; undefined reference to `pspIrKeybInit'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL/src/video/psp/SDL_pspevents.c&#58;249&#58; undefined reference to `pspIrKeybOutputMode'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL.a&#40;SDL_pspevents.o&#41;&#58; In function `PSP_PumpEvents'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL/src/video/psp/SDL_pspevents.c&#58;112&#58; undefined reference to `pspIrKeybReadinput'
collect2&#58; ld returned 1 exit status
make&#58; *** &#91;engine.elf&#93; Error 1
I'm really lost here. Before i started all over again i had 2 errors, now i have a bunch of them. I'm guessing that it has something to do with the positions of the libs i include, because when i change the positions i get different errors, but none of them are error free.

I also tried the contents of /trunk/tests/SDL/ and that works fine. Also the samples included in the sdk compile and run fine so i guess i'm doing something wrong, but i just figure out what. Can someone shed some light on this?

[EDIT] I'm not a linux guru, but why is my svn directory (~/Projects/PSP/devtools/*) being referred to? The compiled libraries are in the /usr/local/pspdev/* folder. Is this normal?
CpuWhiz
Posts: 42
Joined: Mon Jun 04, 2007 1:30 am

Post by CpuWhiz »

That is where the source file was when you (more like the psplibraries script) compiled the library. It gets added in as debug info to tell you line numbers. That is why it mentions that directory in the errors.

It sounds like you have your main error again. I don't use SDL for my PSP apps, but I am using it for creating a OpenGL window on the PC side and my main function looks like this:

Code: Select all

#ifdef __cplusplus
extern "C" &#123;
#endif

int main&#40;int argc, char *argv&#91;&#93;&#41;
&#123;
        gameInit&#40;argc, argv&#41;;
        gameMainLoop&#40;&#41;;

        return 0;
&#125;;

#ifdef __cplusplus
&#125;
#endif
It seems to be shut up when I do this. The source file it is in is C++ with a cpp extension so I don't need the ifdef blocks, but I put them there out of habit.

Check you are not missing -lpspirkeyb
You are getting close, the rest of them are SDL_mixer and it's missing dependencies. I see you have SDL_mixer in the list so I am not sure why you are getting some of those (could be the order, try SDL_mixer after SDL), but the ov_read, etc. are for ogg. That one is -logg and maybe -lvorbis (not sure if you need that).
User avatar
Oguz286
Posts: 35
Joined: Tue Oct 30, 2007 4:56 am

Post by Oguz286 »

CpuWhiz wrote:That is where the source file was when you (more like the psplibraries script) compiled the library. It gets added in as debug info to tell you line numbers. That is why it mentions that directory in the errors.

It sounds like you have your main error again. I don't use SDL for my PSP apps, but I am using it for creating a OpenGL window on the PC side and my main function looks like this:

Code: Select all

#ifdef __cplusplus
extern "C" &#123;
#endif

int main&#40;int argc, char *argv&#91;&#93;&#41;
&#123;
        gameInit&#40;argc, argv&#41;;
        gameMainLoop&#40;&#41;;

        return 0;
&#125;;

#ifdef __cplusplus
&#125;
#endif
It seems to be shut up when I do this. The source file it is in is C++ with a cpp extension so I don't need the ifdef blocks, but I put them there out of habit.

Check you are not missing -lpspirkeyb
You are getting close, the rest of them are SDL_mixer and it's missing dependencies. I see you have SDL_mixer in the list so I am not sure why you are getting some of those (could be the order, try SDL_mixer after SDL), but the ov_read, etc. are for ogg. That one is -logg and maybe -lvorbis (not sure if you need that).
Thanks for your reply! About the -logg and -lvorbis... i tried them but to no avail.

The pspirkeyb library should do the trick (i'm recompiling everything at the moment, *again*) but when i tried compiling the psplibraries i got an error, so i guess not everything went great. I'll try your suggestions when it's done compiling.

About the extern "C"-bit, do i have to do that to all my .cpp files? Because the rest of the files are compiled without problems, although my main is also getting compiled without problems. Linking all the stuff together on the other hand...
CpuWhiz
Posts: 42
Joined: Mon Jun 04, 2007 1:30 am

Post by CpuWhiz »

No, just the main function. It's expecting the main function to be a C symbol and not a C++ symbol, but everything else wouldn't be referenced by other libraries, so they don't need it (unless you get a weird linker error for them). I am rebuilding my ubuntu gutsy package that includes psptoolchain, psplibraries, prxtool, etc. right now. I am also uploading my old version to rapidshare (made on 2007-10-19). If you are interested in trying with my package let me know. You could have my build script if you really want it. Keep in mind my upload is not very fast. I have never had problems with the setup contained in my package. I build it with a clean install of gutsy and run it on my feisty system (have not upgraded yet, and don't use compiz anyway).
User avatar
Oguz286
Posts: 35
Joined: Tue Oct 30, 2007 4:56 am

Post by Oguz286 »

CpuWhiz wrote:No, just the main function. It's expecting the main function to be a C symbol and not a C++ symbol, but everything else wouldn't be referenced by other libraries, so they don't need it (unless you get a weird linker error for them). I am rebuilding my ubuntu gutsy package that includes psptoolchain, psplibraries, prxtool, etc. right now. I am also uploading my old version to rapidshare (made on 2007-10-19). If you are interested in trying with my package let me know. You could have my build script if you really want it. Keep in mind my upload is not very fast. I have never had problems with the setup contained in my package. I build it with a clean install of gutsy and run it on my feisty system (have not upgraded yet, and don't use compiz anyway).
I would gladly want to try out your package :) If you could send it to me, i could host it on my site. This way i can find out if the error is the human factor (ie. me) or the psptoolchain and libraries (which compile fine).

Well everything is setup without errors, but i'm still getting errors:

Code: Select all

make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I/usr/local/pspdev/psp/include/SDL -Dmain=SDL_main -D_PSP_FW_VERSION=371  -L. -L/usr/local/pspdev/psp/sdk/lib -specs=/usr/local/pspdev/psp/sdk/lib/prxspecs -Wl,-q,-T/usr/local/pspdev/psp/sdk/lib/linkfile.prx   main.o globals/globals.o globals/Timer.o sound/Sound.o sound/SoundEffect.o sound/Music.o graphics/Texture.o graphics/StaticTexture.o graphics/Animation.o graphics/TextureManager.o /usr/local/pspdev/psp/sdk/lib/prxexports.o -lSDLmain -lSDL -lSDL_image -lSDL_mixer -lGLU -lGL -lpng -ljpeg -lz -lm -lstdc++ -lc -lpsputility -lpspdebug -lpspgu -lpspge -lpspdisplay -lpspctrl -lpspvfpu -lpspuser -lpsprtc -lpsppower -lpspdebug -lpspge -lpspaudio -lpspctrl -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpsphprm -lpspirkeyb -lpspsdk -logg -lvorbis -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o engine.elf
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_image.a&#40;IMG_bmp.o&#41;&#58; In function `IMG_LoadBMP_RW'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c&#58;196&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c&#58;197&#58; undefined reference to `SDL_ReadLE16'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c&#58;198&#58; undefined reference to `SDL_ReadLE16'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c&#58;199&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c&#58;202&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c&#58;215&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c&#58;216&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c&#58;217&#58; undefined reference to `SDL_ReadLE16'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c&#58;218&#58; undefined reference to `SDL_ReadLE16'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c&#58;219&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c&#58;220&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c&#58;221&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c&#58;222&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c&#58;223&#58; undefined reference to `SDL_ReadLE32'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_image.a&#40;IMG_bmp.o&#41;&#58;/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c&#58;224&#58; more undefined references to `SDL_ReadLE32' follow
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_image.a&#40;IMG_bmp.o&#41;&#58; In function `IMG_LoadBMP_RW'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c&#58;204&#58; undefined reference to `SDL_ReadLE16'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c&#58;205&#58; undefined reference to `SDL_ReadLE16'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c&#58;206&#58; undefined reference to `SDL_ReadLE16'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c&#58;207&#58; undefined reference to `SDL_ReadLE16'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;mixer.o&#41;&#58; In function `Mix_LoadWAV_RW'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/mixer.c&#58;426&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/mixer.c&#58;433&#58; undefined reference to `SDL_LoadWAV_RW'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/mixer.c&#58;482&#58; undefined reference to `SDL_FreeWAV'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/mixer.c&#58;477&#58; undefined reference to `SDL_FreeWAV'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;mixer.o&#41;&#58; In function `mix_channels'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/mixer.c&#58;207&#58; undefined reference to `SDL_MixAudio'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/mixer.c&#58;231&#58; undefined reference to `SDL_MixAudio'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_internal_playing'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;1115&#58; undefined reference to `SMPEG_status'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_internal_halt'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;992&#58; undefined reference to `SMPEG_stop'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_internal_volume'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;924&#58; undefined reference to `SMPEG_setvolume'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_internal_position'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;841&#58; undefined reference to `SMPEG_skip'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;843&#58; undefined reference to `SMPEG_rewind'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;844&#58; undefined reference to `SMPEG_play'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_internal_play'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;750&#58; undefined reference to `SMPEG_enableaudio'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;751&#58; undefined reference to `SMPEG_enablevideo'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;752&#58; undefined reference to `SMPEG_play'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `Mix_FreeMusic'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;663&#58; undefined reference to `SMPEG_delete'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `Mix_LoadMUS'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;568&#58; undefined reference to `SMPEG_new'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;573&#58; undefined reference to `SMPEG_actualSpec'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_mixer'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c&#58;318&#58; undefined reference to `SMPEG_playAudio'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music_ogg.o&#41;&#58; In function `OGG_jump_to_time'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music_ogg.c&#58;245&#58; undefined reference to `ov_time_seek'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music_ogg.o&#41;&#58; In function `OGG_delete'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music_ogg.c&#58;237&#58; undefined reference to `ov_clear'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music_ogg.o&#41;&#58; In function `OGG_playAudio'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music_ogg.c&#58;214&#58; undefined reference to `SDL_MixAudio'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music_ogg.c&#58;159&#58; undefined reference to `ov_read'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music_ogg.c&#58;173&#58; undefined reference to `ov_info'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music_ogg.o&#41;&#58; In function `OGG_new_RW'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music_ogg.c&#58;126&#58; undefined reference to `ov_open_callbacks'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music_ogg.o&#41;&#58; In function `OGG_new'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music_ogg.c&#58;74&#58; undefined reference to `ov_open'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;wavestream.o&#41;&#58; In function `WAVStream_PlaySome'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c&#58;196&#58; undefined reference to `SDL_MixAudio'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;wavestream.o&#41;&#58; In function `ReadChunk'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c&#58;241&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c&#58;242&#58; undefined reference to `SDL_ReadLE32'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;wavestream.o&#41;&#58; In function `WAVStream_LoadSong'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c&#58;290&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c&#58;291&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c&#58;292&#58; undefined reference to `SDL_ReadLE32'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;wavestream.o&#41;&#58;/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c&#58;441&#58; more undefined references to `SDL_ReadLE32' follow
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;wavestream.o&#41;&#58; In function `WAVStream_LoadSong'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c&#58;442&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c&#58;443&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c&#58;461&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c&#58;462&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c&#58;472&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c&#58;473&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c&#58;481&#58; undefined reference to `SDL_ReadBE16'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c&#58;482&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c&#58;483&#58; undefined reference to `SDL_ReadBE16'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;load_aiff.o&#41;&#58; In function `Mix_LoadAIFF_RW'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c&#58;104&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c&#58;105&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c&#58;111&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c&#58;127&#58; undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c&#58;128&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c&#58;144&#58; undefined reference to `SDL_ReadBE16'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c&#58;145&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c&#58;146&#58; undefined reference to `SDL_ReadBE16'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c&#58;137&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c&#58;138&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c&#58;158&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c&#58;159&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c&#58;160&#58; undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c&#58;161&#58; undefined reference to `SDL_ReadBE16'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;load_ogg.o&#41;&#58; In function `Mix_LoadOGG_RW'&#58;
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_ogg.c&#58;93&#58; undefined reference to `ov_open_callbacks'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_ogg.c&#58;101&#58; undefined reference to `ov_info'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_ogg.c&#58;112&#58; undefined reference to `ov_pcm_total'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_ogg.c&#58;122&#58; undefined reference to `ov_read'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_ogg.c&#58;128&#58; undefined reference to `ov_read'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_ogg.c&#58;140&#58; undefined reference to `ov_clear'
/usr/local/pspdev/psp/sdk/lib/libpspirkeyb.a&#40;pspirkeyb.o&#41;&#58; In function `hama'&#58;
pspirkeyb.c&#58;&#40;.text+0x370&#41;&#58; undefined reference to `scePowerTick'
/usr/local/pspdev/psp/sdk/lib/libpspirkeyb.a&#40;pspirkeyb.o&#41;&#58; In function `palmuw'&#58;
pspirkeyb.c&#58;&#40;.text+0x59c&#41;&#58; undefined reference to `scePowerTick'
/usr/local/pspdev/psp/sdk/lib/libpspirkeyb.a&#40;pspirkeyb.o&#41;&#58; In function `targus_infrared'&#58;
pspirkeyb.c&#58;&#40;.text+0x6ac&#41;&#58; undefined reference to `scePowerTick'
/usr/local/pspdev/psp/sdk/lib/libpspirkeyb.a&#40;pspirkeyb.o&#41;&#58; In function `compaq_microkbd'&#58;
pspirkeyb.c&#58;&#40;.text+0x778&#41;&#58; undefined reference to `scePowerTick'
/usr/local/pspdev/psp/sdk/lib/libpspirkeyb.a&#40;pspirkeyb.o&#41;&#58; In function `micro_datapad'&#58;
pspirkeyb.c&#58;&#40;.text+0x8d4&#41;&#58; undefined reference to `scePowerTick'
/usr/local/pspdev/psp/sdk/lib/libpspirkeyb.a&#40;pspirkeyb.o&#41;&#58;pspirkeyb.c&#58;&#40;.text+0xa6c&#41;&#58; more undefined references to `scePowerTick' follow
collect2&#58; ld returned 1 exit status
make&#58; *** &#91;engine.elf&#93; Error 1
And i'm using extern "C" around my main. I don't get the unreferenced main error anymore, but still no luck running my code on my psp :(

Btw the makefile is:

Code: Select all

TARGET = engine
OBJS = main.o globals/globals.o globals/Timer.o sound/Sound.o sound/SoundEffect.o sound/Music.o graphics/Texture.o graphics/StaticTexture.o graphics/Animation.o graphics/TextureManager.o 

INCDIR = 
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;

LIBDIR =
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP kxploit

PSP_EBOOT_TITLE = OguEngine
PSP_DIR_NAME = OguEngine
BUILD_PRX = 1
PSP_FW_VERSION = 371

PSPSDK = $&#40;shell psp-config --pspsdk-path&#41;
PSPBIN = $&#40;PSPSDK&#41;/../bin
CFLAGS += $&#40;shell $&#40;PSPBIN&#41;/sdl-config --cflags&#41;
LIBS= -lSDLmain -lSDL -lSDL_image -lSDL_mixer -lGLU -lGL -lpng -ljpeg -lz -lm -lstdc++ -lc -lpsputility -lpspdebug -lpspgu -lpspge -lpspdisplay -lpspctrl -lpspvfpu -lpspuser -lpsprtc -lpsppower -lpspdebug -lpspge -lpspaudio -lpspctrl -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpsphprm -lpspirkeyb -lpspsdk
include $&#40;PSPSDK&#41;/lib/build.mak
[EDIT] Here's the output from sdl-config --libs:

Code: Select all

$PSPSDK/../bin/sdl-config --libs
-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
Because of this i could use:

Code: Select all

LIBS += $&#40;shell $&#40;PSPBIN&#41;/sdl-config --libs&#41; -lstdc++ -lSDL_image -lpng -ljpeg -lz -lSDL_mixer
as being suggested by the SDL's Readme.PSP file. But then i get other errors. I'm really starting to get frustrated :P

Oh linker, oh linker, what foul ways do you have to really annoy me? :P
CpuWhiz
Posts: 42
Joined: Mon Jun 04, 2007 1:30 am

Post by CpuWhiz »

I am currently hanging out in #pspdev on freenode if you want to venture x-chat in there. Also it would go faster if I had the source and could try it on my system and fiddle with the LIBS line. If you don't want to share your source, that's fine, I understand. I am not too keen on sharing source to my program either. Just saying if you are willing to that would help things go faster.

As for my package, I am updating my gutsy install and will run my script as soon as it finishes. The old version that I am currently using is @ 19% and says another 152 minutes. I assume rapidshare is ok?
User avatar
Oguz286
Posts: 35
Joined: Tue Oct 30, 2007 4:56 am

Post by Oguz286 »

CpuWhiz wrote:I am currently hanging out in #pspdev on freenode if you want to venture x-chat in there. Also it would go faster if I had the source and could try it on my system and fiddle with the LIBS line. If you don't want to share your source, that's fine, I understand. I am not too keen on sharing source to my program either. Just saying if you are willing to that would help things go faster.

As for my package, I am updating my gutsy install and will run my script as soon as it finishes. The old version that I am currently using is @ 19% and says another 152 minutes. I assume rapidshare is ok?
I don't really mind sharing the source if it helps. You could put it on rapidshare, that's fine. Btw, i'm trying to get into #pspdev on irc.freenode.net but i have to be registered and i have no idea how to register myself there (yes, i'm a irc n00b).
Last edited by Oguz286 on Mon Dec 10, 2007 2:53 am, edited 1 time in total.
CpuWhiz
Posts: 42
Joined: Mon Jun 04, 2007 1:30 am

Post by CpuWhiz »

Join #ubuntu or #kubuntu then and mention my name - CpuWhiz and I will help you register. It's freenode.net BTW, but I will assume you got connected anyway.
User avatar
Oguz286
Posts: 35
Joined: Tue Oct 30, 2007 4:56 am

Post by Oguz286 »

Ok so CpuWhiz helped me all day long to get a clean psptoolchain and libraries and made an ubuntu package. Everything installed great and my code compiles on his computer and runs on his psp, but i still can't compile it on my laptop.

These are the errors:

Code: Select all

make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -DPLATFORM_PSP -D_PSP_FW_VERSION=371  -L. -L/usr/local/pspdev/psp/sdk/lib -specs=/usr/local/pspdev/psp/sdk/lib/prxspecs -Wl,-q,-T/usr/local/pspdev/psp/sdk/lib/linkfile.prx   main.o globals/globals.o globals/Timer.o sound/Sound.o sound/SoundEffect.o sound/Music.o graphics/Texture.o graphics/StaticTexture.o graphics/Animation.o graphics/TextureManager.o /usr/local/pspdev/psp/sdk/lib/prxexports.o -lSDL_mixer -lvorbisfile -lvorbis -logg -lSDL_image -lSDL -lSDLmain -lpng -ljpeg -lGL -lpspgu -lpsprtc -lpspvfpu -lpspirkeyb -lpspaudio -lpsphprm -lpsppower -lstdc++ -lz -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o engine.elf
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_internal_playing'&#58;
/home/oguz/Projects/PSP/devtools/pspnew/package_script/psplibraries/build/SDL_mixer/music.c&#58;1115&#58; undefined reference to `SMPEG_status'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_internal_halt'&#58;
/home/oguz/Projects/PSP/devtools/pspnew/package_script/psplibraries/build/SDL_mixer/music.c&#58;992&#58; undefined reference to `SMPEG_stop'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_internal_volume'&#58;
/home/oguz/Projects/PSP/devtools/pspnew/package_script/psplibraries/build/SDL_mixer/music.c&#58;924&#58; undefined reference to `SMPEG_setvolume'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_internal_position'&#58;
/home/oguz/Projects/PSP/devtools/pspnew/package_script/psplibraries/build/SDL_mixer/music.c&#58;841&#58; undefined reference to `SMPEG_skip'
/home/oguz/Projects/PSP/devtools/pspnew/package_script/psplibraries/build/SDL_mixer/music.c&#58;843&#58; undefined reference to `SMPEG_rewind'
/home/oguz/Projects/PSP/devtools/pspnew/package_script/psplibraries/build/SDL_mixer/music.c&#58;844&#58; undefined reference to `SMPEG_play'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_internal_play'&#58;
/home/oguz/Projects/PSP/devtools/pspnew/package_script/psplibraries/build/SDL_mixer/music.c&#58;750&#58; undefined reference to `SMPEG_enableaudio'
/home/oguz/Projects/PSP/devtools/pspnew/package_script/psplibraries/build/SDL_mixer/music.c&#58;751&#58; undefined reference to `SMPEG_enablevideo'
/home/oguz/Projects/PSP/devtools/pspnew/package_script/psplibraries/build/SDL_mixer/music.c&#58;752&#58; undefined reference to `SMPEG_play'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `Mix_FreeMusic'&#58;
/home/oguz/Projects/PSP/devtools/pspnew/package_script/psplibraries/build/SDL_mixer/music.c&#58;663&#58; undefined reference to `SMPEG_delete'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `Mix_LoadMUS'&#58;
/home/oguz/Projects/PSP/devtools/pspnew/package_script/psplibraries/build/SDL_mixer/music.c&#58;568&#58; undefined reference to `SMPEG_new'
/home/oguz/Projects/PSP/devtools/pspnew/package_script/psplibraries/build/SDL_mixer/music.c&#58;573&#58; undefined reference to `SMPEG_actualSpec'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_mixer'&#58;
/home/oguz/Projects/PSP/devtools/pspnew/package_script/psplibraries/build/SDL_mixer/music.c&#58;318&#58; undefined reference to `SMPEG_playAudio'
collect2&#58; ld returned 1 exit status
make&#58; *** &#91;engine.elf&#93; Error 1
So it has something to do with the SMPEG library. I searched synaptic to find something that resembles this, but i already have everything installed. I'm all out of ideas and i'm starting to get a bit depressed. Does anyone have a solution for this?
User avatar
Oguz286
Posts: 35
Joined: Tue Oct 30, 2007 4:56 am

Post by Oguz286 »

I finally solved it. I found a SMPEG library for psp with the help of google and added it to the library. Wouldn't it be wise to put it in the SVN? People wouldn't have to spend 2 days figuring out how to compile their code :)
Post Reply