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(IMG_bmp.o): In function `IMG_LoadBMP_RW':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c:196: undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c:197: undefined reference to `SDL_ReadLE16'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c:198: undefined reference to `SDL_ReadLE16'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c:199: undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c:202: undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c:215: undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c:216: undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c:217: undefined reference to `SDL_ReadLE16'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c:218: undefined reference to `SDL_ReadLE16'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c:219: undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c:220: undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c:221: undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c:222: undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c:223: undefined reference to `SDL_ReadLE32'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_image.a(IMG_bmp.o):/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c:224: more undefined references to `SDL_ReadLE32' follow
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_image.a(IMG_bmp.o): In function `IMG_LoadBMP_RW':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c:204: undefined reference to `SDL_ReadLE16'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c:205: undefined reference to `SDL_ReadLE16'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c:206: undefined reference to `SDL_ReadLE16'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_image/IMG_bmp.c:207: undefined reference to `SDL_ReadLE16'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a(mixer.o): In function `Mix_LoadWAV_RW':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/mixer.c:426: undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/mixer.c:433: undefined reference to `SDL_LoadWAV_RW'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/mixer.c:482: undefined reference to `SDL_FreeWAV'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/mixer.c:477: undefined reference to `SDL_FreeWAV'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a(mixer.o): In function `mix_channels':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/mixer.c:207: undefined reference to `SDL_MixAudio'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/mixer.c:231: undefined reference to `SDL_MixAudio'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a(music.o): In function `music_internal_playing':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c:1115: undefined reference to `SMPEG_status'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a(music.o): In function `music_internal_halt':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c:992: undefined reference to `SMPEG_stop'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a(music.o): In function `music_internal_volume':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c:924: undefined reference to `SMPEG_setvolume'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a(music.o): In function `music_internal_position':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c:841: undefined reference to `SMPEG_skip'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c:843: undefined reference to `SMPEG_rewind'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c:844: undefined reference to `SMPEG_play'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a(music.o): In function `music_internal_play':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c:750: undefined reference to `SMPEG_enableaudio'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c:751: undefined reference to `SMPEG_enablevideo'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c:752: undefined reference to `SMPEG_play'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a(music.o): In function `Mix_FreeMusic':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c:663: undefined reference to `SMPEG_delete'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a(music.o): In function `Mix_LoadMUS':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c:568: undefined reference to `SMPEG_new'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c:573: undefined reference to `SMPEG_actualSpec'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a(music.o): In function `music_mixer':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music.c:318: undefined reference to `SMPEG_playAudio'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a(music_ogg.o): In function `OGG_jump_to_time':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music_ogg.c:245: undefined reference to `ov_time_seek'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a(music_ogg.o): In function `OGG_delete':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music_ogg.c:237: undefined reference to `ov_clear'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a(music_ogg.o): In function `OGG_playAudio':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music_ogg.c:214: undefined reference to `SDL_MixAudio'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music_ogg.c:159: undefined reference to `ov_read'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music_ogg.c:173: undefined reference to `ov_info'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a(music_ogg.o): In function `OGG_new_RW':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music_ogg.c:126: undefined reference to `ov_open_callbacks'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a(music_ogg.o): In function `OGG_new':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/music_ogg.c:74: undefined reference to `ov_open'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a(wavestream.o): In function `WAVStream_PlaySome':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c:196: undefined reference to `SDL_MixAudio'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a(wavestream.o): In function `ReadChunk':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c:241: undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c:242: undefined reference to `SDL_ReadLE32'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a(wavestream.o): In function `WAVStream_LoadSong':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c:290: undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c:291: undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c:292: undefined reference to `SDL_ReadLE32'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a(wavestream.o):/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c:441: more undefined references to `SDL_ReadLE32' follow
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a(wavestream.o): In function `WAVStream_LoadSong':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c:442: undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c:443: undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c:461: undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c:462: undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c:472: undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c:473: undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c:481: undefined reference to `SDL_ReadBE16'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c:482: undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/wavestream.c:483: undefined reference to `SDL_ReadBE16'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a(load_aiff.o): In function `Mix_LoadAIFF_RW':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c:104: undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c:105: undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c:111: undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c:127: undefined reference to `SDL_ReadLE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c:128: undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c:144: undefined reference to `SDL_ReadBE16'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c:145: undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c:146: undefined reference to `SDL_ReadBE16'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c:137: undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c:138: undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c:158: undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c:159: undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c:160: undefined reference to `SDL_ReadBE32'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_aiff.c:161: undefined reference to `SDL_ReadBE16'
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libSDL_mixer.a(load_ogg.o): In function `Mix_LoadOGG_RW':
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_ogg.c:93: undefined reference to `ov_open_callbacks'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_ogg.c:101: undefined reference to `ov_info'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_ogg.c:112: undefined reference to `ov_pcm_total'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_ogg.c:122: undefined reference to `ov_read'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_ogg.c:128: undefined reference to `ov_read'
/home/oguz/Projects/PSP/devtools/psplibraries/build/SDL_mixer/load_ogg.c:140: undefined reference to `ov_clear'
/usr/local/pspdev/psp/sdk/lib/libpspirkeyb.a(pspirkeyb.o): In function `hama':
pspirkeyb.c:(.text+0x370): undefined reference to `scePowerTick'
/usr/local/pspdev/psp/sdk/lib/libpspirkeyb.a(pspirkeyb.o): In function `palmuw':
pspirkeyb.c:(.text+0x59c): undefined reference to `scePowerTick'
/usr/local/pspdev/psp/sdk/lib/libpspirkeyb.a(pspirkeyb.o): In function `targus_infrared':
pspirkeyb.c:(.text+0x6ac): undefined reference to `scePowerTick'
/usr/local/pspdev/psp/sdk/lib/libpspirkeyb.a(pspirkeyb.o): In function `compaq_microkbd':
pspirkeyb.c:(.text+0x778): undefined reference to `scePowerTick'
/usr/local/pspdev/psp/sdk/lib/libpspirkeyb.a(pspirkeyb.o): In function `micro_datapad':
pspirkeyb.c:(.text+0x8d4): undefined reference to `scePowerTick'
/usr/local/pspdev/psp/sdk/lib/libpspirkeyb.a(pspirkeyb.o):pspirkeyb.c:(.text+0xa6c): more undefined references to `scePowerTick' follow
collect2: ld returned 1 exit status
make: *** [engine.elf] 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 = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP kxploit
PSP_EBOOT_TITLE = OguEngine
PSP_DIR_NAME = OguEngine
BUILD_PRX = 1
PSP_FW_VERSION = 371
PSPSDK = $(shell psp-config --pspsdk-path)
PSPBIN = $(PSPSDK)/../bin
CFLAGS += $(shell $(PSPBIN)/sdl-config --cflags)
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 $(PSPSDK)/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 += $(shell $(PSPBIN)/sdl-config --libs) -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