need help: porting library to psp (SDL_mixer problem now)

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

Moderators: cheriff, TyRaNiD

Post Reply
fungos
Posts: 41
Joined: Wed Oct 31, 2007 10:43 am
Location: cwb br
Contact:

need help: porting library to psp (SDL_mixer problem now)

Post by fungos »

I'm trying to port a library to psp, and I'm getting this error (config.log):

Code: Select all

configure:2778: checking for C++ compiler default output file name
configure:2805: psp-g++   -L/home/fungos/dev/psp/dev/psp/sdk/lib -lc -lpspuser conftest.cpp  >&5
/home/fungos/dev/psp/dev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(_exit.o): In function `_exit':
../../../../../../newlib/libc/sys/psp/libcglue.c:864: undefined reference to `sceKernelSelfStopUnloadModule'
../../../../../../newlib/libc/sys/psp/libcglue.c:871: undefined reference to `sceKernelExitThread'
(... and so on ...)
Note: I changed configuire.in and config.sub only (based on the ones from SDL), I just doesn't understand dist tools/files yet, any help is appreciated.

Note2: The library is fully OO and uses SDL and/or OpenGL.

Thanks, I hope I can be able to contribute one great library to psp development.

Bye
Last edited by fungos on Sun Nov 18, 2007 7:49 am, edited 2 times in total.
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

I got a gut feeling you'll have to link more libraries than that.
fungos
Posts: 41
Joined: Wed Oct 31, 2007 10:43 am
Location: cwb br
Contact:

Post by fungos »

Ok, I found where I was defining that two libraries (lol, my psplibraries own build script....)

I added more libraries until I got stuck here:

Code: Select all

configure:2778: checking for C++ compiler default output file name
configure:2805: psp-g++   -L/home/fungos/dev/psp/dev/psp/sdk/lib -lc -lpsplibc -lpspuser -lpspkernel conftest.cpp  >&5
/home/fungos/dev/psp/dev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(fdman.o): In function `__psp_fdman_init':
../../../../../../newlib/libc/sys/psp/fdman.c:29: undefined reference to `sceKernelStdin'
../../../../../../newlib/libc/sys/psp/fdman.c:35: undefined reference to `sceKernelStdout'
../../../../../../newlib/libc/sys/psp/fdman.c:41: undefined reference to `sceKernelStderr'
/home/fungos/dev/psp/dev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(pipe.o): In function `__psp_pipe_nonblocking_write':
../../../../../../newlib/libc/sys/psp/pipe.c:293: undefined reference to `sceKernelTrySendMsgPipe'
/home/fungos/dev/psp/dev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(pipe.o): In function `__psp_pipe_write':
../../../../../../newlib/libc/sys/psp/pipe.c:262: undefined reference to `sceKernelSendMsgPipe'
/home/fungos/dev/psp/dev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(pipe.o): In function `__psp_pipe_read':
../../../../../../newlib/libc/sys/psp/pipe.c:218: undefined reference to `sceKernelReceiveMsgPipe'
/home/fungos/dev/psp/dev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(pipe.o): In function `__psp_pipe_close':
../../../../../../newlib/libc/sys/psp/pipe.c:104: undefined reference to `sceKernelDeleteMsgPipe'
I searched trough pspsdk libraries (with nm and grep) and havent found these symbols anywhere else than pspuser and pspkernel. What I'm doing wrong or missing this time?

The problem is with psp-g++... if I try to compile with psp-gcc it works. But I need use psp-g++.
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

odd :/ I cant find them either.. Maybe its an external library.. One of the more experienced members will have to help you..
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

Add another "-lc" at the front of the libraries. g++ moves the first one and messes up the order. See http://forums.ps2dev.org/viewtopic.php?p=34441#34441
fungos
Posts: 41
Joined: Wed Oct 31, 2007 10:43 am
Location: cwb br
Contact:

Post by fungos »

Thanks jimparis, I read all threads about that issue, but I still having some problem with this.

The two -lc worked, but now I still get some errors.

these are the current errors, and again, I can only find these calls on pspuser and pspkernel.

Code: Select all

/home/fungos/dev/psp/dev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(_write.o): In function `_write':
../../../../../../newlib/libc/sys/psp/libcglue.c:308: undefined reference to `sceIoWrite'
/home/fungos/dev/psp/dev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(pipe.o): In function `__psp_pipe_nonblocking_write':
../../../../../../newlib/libc/sys/psp/pipe.c:293: undefined reference to `sceKernelTrySendMsgPipe'
/home/fungos/dev/psp/dev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(pipe.o): In function `__psp_pipe_write':
../../../../../../newlib/libc/sys/psp/pipe.c:262: undefined reference to `sceKernelSendMsgPipe'
/home/fungos/dev/psp/dev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(pipe.o): In function `__psp_pipe_read':
../../../../../../newlib/libc/sys/psp/pipe.c:218: undefined reference to `sceKernelReceiveMsgPipe'
/home/fungos/dev/psp/dev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(pipe.o): In function `__psp_pipe_close':
../../../../../../newlib/libc/sys/psp/pipe.c:104: undefined reference to `sceKernelDeleteMsgPipe'
/home/fungos/dev/psp/dev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(pipe.o): In function `pipe':
../../../../../../newlib/libc/sys/psp/pipe.c:54: undefined reference to `sceKernelCreateMsgPipe'
../../../../../../newlib/libc/sys/psp/pipe.c:74: undefined reference to `sceKernelDeleteMsgPipe'
/home/fungos/dev/psp/dev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(pipe.o): In function `__psp_pipe_peekmsgsize':
../../../../../../newlib/libc/sys/psp/pipe.c:38: undefined reference to `sceKernelReferMsgPipeStatus'
/home/fungos/dev/psp/dev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(pipe.o): In function `__psp_pipe_nonblocking_read':
../../../../../../newlib/libc/sys/psp/pipe.c:156: undefined reference to `sceKernelTryReceiveMsgPipe'
/home/fungos/dev/psp/dev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(_close.o): In function `_close':
../../../../../../newlib/libc/sys/psp/libcglue.c:236: undefined reference to `sceIoClose'
/home/fungos/dev/psp/dev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(_fstat.o): In function `_fstat':
../../../../../../newlib/libc/sys/psp/libcglue.c:580: undefined reference to `sceIoLseek'
../../../../../../newlib/libc/sys/psp/libcglue.c:582: undefined reference to `sceIoLseek'
../../../../../../newlib/libc/sys/psp/libcglue.c:583: undefined reference to `sceIoLseek'
/home/fungos/dev/psp/dev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(_lseek.o): In function `_lseek':
../../../../../../newlib/libc/sys/psp/libcglue.c:345: undefined reference to `sceIoLseek'
/home/fungos/dev/psp/dev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(_read.o): In function `_read':
../../../../../../newlib/libc/sys/psp/libcglue.c:271: undefined reference to `sceIoRead'
/home/fungos/dev/psp/dev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(_stat.o): In function `_stat':
../../../../../../newlib/libc/sys/psp/libcglue.c:642: undefined reference to `sceIoGetstat'
So, to be easier help me, this is what I'm trying to get working:

Code: Select all

psp-g++ -L`psp-config --pspsdk-path`/lib -lc -lc -lpspuser conftest.cpp
Just remembering... If I use psp-gcc with -lstdc++ it works ok. But I can't change it, because its the automatic ./configure compiler detection. Thank you for all the help, I hope I can get this library working for you people. :)

EDIT:
Ok, -fno-exceptions did the work. But I want to know more about this problem (if someone can explain me why the need for no-exceptions).
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

-Wl,--start-group would also work. It is just a linker ordering issue (all dependences must come after the functions that use them) and exceptions probably adds more libraries to the end.
fungos
Posts: 41
Joined: Wed Oct 31, 2007 10:43 am
Location: cwb br
Contact:

Post by fungos »

I found a good topic about this problem, and you was explaining the problems with this in psptoolchain. Thank you for your help! I get the configure to work, now I'm fixing other minor problems.
fungos
Posts: 41
Joined: Wed Oct 31, 2007 10:43 am
Location: cwb br
Contact:

Post by fungos »

Well, the things are each time worse. The library that I'm trying to port is called guichan (take a look at it http://guichan.sourceforge.net/), its a very good GUI framework that uses SDL and/or OpenGL.

After being able to compile the library, I was trying to get it sample program running, but as expected, It failed.

Anyway, my current problem is very weird, I never saw error messages like these .rodata and vtable errors.

Code: Select all

fungos@Darkbrain:~/dev/psp/psplibraries/guichan/guichanffdemo-0.7.1$ psp-g++ -I. -I/home/fungos/dev/psp/dev/psp/sdk/include -lc -O2 -G0 -Wall -fno-exceptions -fno-rtti -I/home/fungos/dev/psp/dev/psp/include/SDL -Dmain=SDL_main -I/usr/local/include -lSDLmain -lguichan_opengl -lguichan_sdl -lguichan -D_PSP_FW_VERSION=150  -L. -L/home/fungos/dev/psp/dev/psp/sdk/lib   src/ffcharacterchooser.o src/ffcontainer.o src/ffdemo.o src/fflistbox.o src/ffscrollarea.o src/guichanffdemo.o -lstdc++ -L/home/fungos/dev/psp/dev/psp/lib -lSDLmain -lSDL -lm -lGL -lpspvfpu -L/home/fungos/dev/psp/dev/psp/sdk/lib -lc -lpspdebug -lpspgu -lpspctrl -lpspge -lpspdisplay -lpsphprm -lpspsdk -lpsprtc -lpspaudio -lc -lpspuser -lpsputility -lpspkernel -lpspnet_inet -lpspirkeyb -lpsppower -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel
/home/fungos/dev/psp/dev/psp/lib/libSDLmain.a(SDL_psp_main.o): In function `main':
psp/SDL_psp_main.c:178: undefined reference to `SDL_main'
src/ffcharacterchooser.o: In function `FFCharacterChooser::keyPressed(gcn::KeyEvent&)':
ffcharacterchooser.cpp:(.text+0xa4): undefined reference to `gcn::KeyEvent::getKey() const'
ffcharacterchooser.cpp:(.text+0xac): undefined reference to `gcn::Key::getValue() const'
ffcharacterchooser.cpp:(.text+0xc0): undefined reference to `gcn::KeyEvent::getKey() const'
ffcharacterchooser.cpp:(.text+0xc8): undefined reference to `gcn::Key::getValue() const'
ffcharacterchooser.cpp:(.text+0xdc): undefined reference to `gcn::KeyEvent::getKey() const'
ffcharacterchooser.cpp:(.text+0xe4): undefined reference to `gcn::Key::getValue() const'
ffcharacterchooser.cpp:(.text+0x170): undefined reference to `gcn::Widget::generateAction()'
src/ffcharacterchooser.o: In function `FFCharacterChooser::~FFCharacterChooser()':
ffcharacterchooser.cpp:(.text+0x1d4): undefined reference to `gcn::Widget::~Widget()'
src/ffcharacterchooser.o: In function `FFCharacterChooser::~FFCharacterChooser()':
ffcharacterchooser.cpp:(.text+0x238): undefined reference to `gcn::Widget::~Widget()'
src/ffcharacterchooser.o: In function `FFCharacterChooser::~FFCharacterChooser()':
ffcharacterchooser.cpp:(.text+0x290): undefined reference to `gcn::Widget::~Widget()'
src/ffcharacterchooser.o: In function `FFCharacterChooser::FFCharacterChooser()':
ffcharacterchooser.cpp:(.text+0x2c0): undefined reference to `gcn::Widget::Widget()'
ffcharacterchooser.cpp:(.text+0x2e4): undefined reference to `gcn::Widget::setWidth(int)'
ffcharacterchooser.cpp:(.text+0x2f0): undefined reference to `gcn::Widget::setHeight(int)'
ffcharacterchooser.cpp&#58;&#40;.text+0x320&#41;&#58; undefined reference to `gcn&#58;&#58;Image&#58;&#58;load&#40;std&#58;&#58;basic_string<char, std&#58;&#58;char_traits<char>, std&#58;&#58;allocator<char> > const&, bool&#41;'
..
..
..
..
src/ffscrollarea.o&#58;&#40;.rodata._ZTV12FFScrollArea&#91;vtable for FFScrollArea&#93;+0x1f4&#41;&#58; undefined reference to `gcn&#58;&#58;ScrollArea&#58;&#58;getUpButtonDimension&#40;&#41;'
src/ffscrollarea.o&#58;&#40;.rodata._ZTV12FFScrollArea&#91;vtable for FFScrollArea&#93;+0x1f8&#41;&#58; undefined reference to `gcn&#58;&#58;ScrollArea&#58;&#58;getDownButtonDimension&#40;&#41;'
src/ffscrollarea.o&#58;&#40;.rodata._ZTV12FFScrollArea&#91;vtable for FFScrollArea&#93;+0x1fc&#41;&#58; undefined reference to `gcn&#58;&#58;ScrollArea&#58;&#58;getLeftButtonDimension&#40;&#41;'
src/ffscrollarea.o&#58;&#40;.rodata._ZTV12FFScrollArea&#91;vtable for FFScrollArea&#93;+0x200&#41;&#58; undefined reference to `gcn&#58;&#58;ScrollArea&#58;&#58;getRightButtonDimension&#40;&#41;'
src/ffscrollarea.o&#58;&#40;.rodata._ZTV12FFScrollArea&#91;vtable for FFScrollArea&#93;+0x204&#41;&#58; undefined reference to `gcn&#58;&#58;ScrollArea&#58;&#58;getVerticalBarDimension&#40;&#41;'
src/ffscrollarea.o&#58;&#40;.rodata._ZTV12FFScrollArea&#91;vtable for FFScrollArea&#93;+0x208&#41;&#58; undefined reference to `gcn&#58;&#58;ScrollArea&#58;&#58;getHorizontalBarDimension&#40;&#41;'
src/ffscrollarea.o&#58;&#40;.rodata._ZTV12FFScrollArea&#91;vtable for FFScrollArea&#93;+0x20c&#41;&#58; undefined reference to `gcn&#58;&#58;ScrollArea&#58;&#58;getVerticalMarkerDimension&#40;&#41;'
src/ffscrollarea.o&#58;&#40;.rodata._ZTV12FFScrollArea&#91;vtable for FFScrollArea&#93;+0x210&#41;&#58; undefined reference to `gcn&#58;&#58;ScrollArea&#58;&#58;getHorizontalMarkerDimension&#40;&#41;'
..
..
..
..
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

The first error (undefined SDL_main) is because you need to put the main() function inside an 'extern "C" {}' block, search other threads for more discussion on SDL and C++.

The other undefined references are probably because you're missing some library or object file where those symbols are defined (gcn::KeyEvent::GetKey, etc).
fungos
Posts: 41
Joined: Wed Oct 31, 2007 10:43 am
Location: cwb br
Contact:

Post by fungos »

Thanks again, you're being very nice and helpful :)

Now, what I think is the last problem:


When linking without -lSDL_mixer:

Code: Select all

psp-gcc -I. -I/home/fungos/dev/psp/dev/psp/sdk/include -O2 -G0 -Wall -fno-exceptions -fno-rtti -I/home/fungos/dev/psp/dev/psp/include/SDL -Dmain=SDL_main -I/usr/local/include  -D_PSP_FW_VERSION=150  -L. -L/home/fungos/dev/psp/dev/psp/sdk/lib   src/ffcharacterchooser.o src/ffcontainer.o src/ffdemo.o src/fflistbox.o src/ffscrollarea.o src/guichanffdemo.o -lguichan_opengl -lguichan_sdl -lguichan -lSDL_image -lpng -lz -lfreetype -ljpeg -lSDL_gfx -lSDL_ttf -lvorbisfile -lvorbis -logg -lSDL -lm -L/home/fungos/dev/psp/dev/psp/lib -lSDLmain -lSDL -lm -lGL -lpspvfpu -L/home/fungos/dev/psp/dev/psp/sdk/lib -lpspdebug -lpspgu -lpspctrl -lpspge -lpspdisplay -lpsphprm -lpspsdk -lpsprtc -lpspaudio -lc -lpspuser -lpsputility -lpspkernel -lpspnet_inet -lpspirkeyb -lpsppower -lstdc++ -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o guichan.psp.elf
src/ffdemo.o&#58; In function `FFDemo&#58;&#58;~FFDemo&#40;&#41;'&#58;
ffdemo.cpp&#58;&#40;.text+0x770&#41;&#58; undefined reference to `Mix_FreeChunk'
ffdemo.cpp&#58;&#40;.text+0x778&#41;&#58; undefined reference to `Mix_FreeChunk'
ffdemo.cpp&#58;&#40;.text+0x780&#41;&#58; undefined reference to `Mix_CloseAudio'
src/ffdemo.o&#58; In function `FFDemo&#58;&#58;~FFDemo&#40;&#41;'&#58;
ffdemo.cpp&#58;&#40;.text+0x9fc&#41;&#58; undefined reference to `Mix_FreeChunk'
ffdemo.cpp&#58;&#40;.text+0xa04&#41;&#58; undefined reference to `Mix_FreeChunk'
ffdemo.cpp&#58;&#40;.text+0xa0c&#41;&#58; undefined reference to `Mix_CloseAudio'
src/ffdemo.o&#58; In function `FFDemo&#58;&#58;~FFDemo&#40;&#41;'&#58;
ffdemo.cpp&#58;&#40;.text+0xc88&#41;&#58; undefined reference to `Mix_FreeChunk'
ffdemo.cpp&#58;&#40;.text+0xc90&#41;&#58; undefined reference to `Mix_FreeChunk'
ffdemo.cpp&#58;&#40;.text+0xc98&#41;&#58; undefined reference to `Mix_CloseAudio'
src/ffdemo.o&#58; In function `FFDemo&#58;&#58;input&#40;&#41;'&#58;
ffdemo.cpp&#58;&#40;.text+0xebc&#41;&#58; undefined reference to `Mix_PlayChannelTimed'
ffdemo.cpp&#58;&#40;.text+0xf1c&#41;&#58; undefined reference to `Mix_PlayChannelTimed'
src/ffdemo.o&#58; In function `FFDemo&#58;&#58;FFDemo&#40;&#41;'&#58;
ffdemo.cpp&#58;&#40;.text+0x563c&#41;&#58; undefined reference to `Mix_OpenAudio'
ffdemo.cpp&#58;&#40;.text+0x565c&#41;&#58; undefined reference to `Mix_LoadWAV_RW'
ffdemo.cpp&#58;&#40;.text+0x567c&#41;&#58; undefined reference to `Mix_LoadWAV_RW'
src/ffdemo.o&#58; In function `FFDemo&#58;&#58;FFDemo&#40;&#41;'&#58;
ffdemo.cpp&#58;&#40;.text+0x636c&#41;&#58; undefined reference to `Mix_OpenAudio'
ffdemo.cpp&#58;&#40;.text+0x638c&#41;&#58; undefined reference to `Mix_LoadWAV_RW'
ffdemo.cpp&#58;&#40;.text+0x63ac&#41;&#58; undefined reference to `Mix_LoadWAV_RW'
collect2&#58; ld returned 1 exit status
make&#91;1&#93;&#58; *** &#91;guichan.psp.elf&#93; Error 1
make&#91;1&#93;&#58; Leaving directory `/home/fungos/dev/psp/psplibraries/guichan/guichanffdemo-0.7.1'
make&#58; *** &#91;psp&#93; Error 2
When linking with -lSDL_mixer:

Code: Select all

psp-gcc -I. -I/home/fungos/dev/psp/dev/psp/sdk/include -O2 -G0 -Wall -fno-exceptions -fno-rtti -I/home/fungos/dev/psp/dev/psp/include/SDL -Dmain=SDL_main -I/usr/local/include  -D_PSP_FW_VERSION=150  -L. -L/home/fungos/dev/psp/dev/psp/sdk/lib   src/ffcharacterchooser.o src/ffcontainer.o src/ffdemo.o src/fflistbox.o src/ffscrollarea.o src/guichanffdemo.o -lguichan_opengl -lguichan_sdl -lguichan -lSDL_image -lpng -lz -lfreetype -ljpeg -lSDL_gfx -lSDL_ttf -lSDL_mixer -lvorbisfile -lvorbis -logg -lSDL -lm -L/home/fungos/dev/psp/dev/psp/lib -lSDLmain -lSDL -lm -lGL -lpspvfpu -L/home/fungos/dev/psp/dev/psp/sdk/lib -lpspdebug -lpspgu -lpspctrl -lpspge -lpspdisplay -lpsphprm -lpspsdk -lpsprtc -lpspaudio -lc -lpspuser -lpsputility -lpspkernel -lpspnet_inet -lpspirkeyb -lpsppower -lstdc++ -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o guichan.psp.elf
/home/fungos/dev/psp/dev/psp/lib/libSDL_mixer.a&#40;mplayer.o&#41;&#58; In function `Player_SetSynchroValue'&#58;
/home/fungos/dev/psp/psplibraries/build/SDL_mixer/mikmod/mplayer.c&#58;2908&#58; multiple definition of `Player_SetSynchroValue'
/home/fungos/dev/psp/dev/psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58;/home/fungos/dev/psp/psplibraries/build/SDL_mixer/music.c&#58;1160&#58; first defined here
/home/fungos/dev/psp/dev/psp/lib/libSDL_mixer.a&#40;mplayer.o&#41;&#58; In function `Player_GetSynchroValue'&#58;
/home/fungos/dev/psp/psplibraries/build/SDL_mixer/mikmod/mplayer.c&#58;2914&#58; multiple definition of `Player_GetSynchroValue'
/home/fungos/dev/psp/dev/psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58;/home/fungos/dev/psp/psplibraries/build/SDL_mixer/music.c&#58;1166&#58; first defined here
/home/fungos/dev/psp/dev/psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_internal_playing'&#58;
music.c&#58;&#40;.text+0x6f4&#41;&#58; undefined reference to `SMPEG_status'
/home/fungos/dev/psp/dev/psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_internal_halt'&#58;
music.c&#58;&#40;.text+0x808&#41;&#58; undefined reference to `SMPEG_stop'
/home/fungos/dev/psp/dev/psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_internal_volume'&#58;
music.c&#58;&#40;.text+0xa0c&#41;&#58; undefined reference to `SMPEG_setvolume'
/home/fungos/dev/psp/dev/psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_internal_position'&#58;
music.c&#58;&#40;.text+0xb9c&#41;&#58; undefined reference to `SMPEG_skip'
music.c&#58;&#40;.text+0xbf8&#41;&#58; undefined reference to `SMPEG_rewind'
music.c&#58;&#40;.text+0xc04&#41;&#58; undefined reference to `SMPEG_play'
/home/fungos/dev/psp/dev/psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_internal_play'&#58;
music.c&#58;&#40;.text+0xe0c&#41;&#58; undefined reference to `SMPEG_enableaudio'
music.c&#58;&#40;.text+0xe18&#41;&#58; undefined reference to `SMPEG_enablevideo'
music.c&#58;&#40;.text+0xe24&#41;&#58; undefined reference to `SMPEG_play'
/home/fungos/dev/psp/dev/psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `Mix_FreeMusic'&#58;
music.c&#58;&#40;.text+0x109c&#41;&#58; undefined reference to `SMPEG_delete'
/home/fungos/dev/psp/dev/psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `Mix_LoadMUS'&#58;
music.c&#58;&#40;.text+0x13c8&#41;&#58; undefined reference to `SMPEG_new'
music.c&#58;&#40;.text+0x14f4&#41;&#58; undefined reference to `SMPEG_actualSpec'
/home/fungos/dev/psp/dev/psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58; In function `music_mixer'&#58;
music.c&#58;&#40;.text+0x1b58&#41;&#58; undefined reference to `SMPEG_playAudio'
collect2&#58; ld returned 1 exit status
make&#91;1&#93;&#58; *** &#91;guichan.psp.elf&#93; Error 1
make&#91;1&#93;&#58; Leaving directory `/home/fungos/dev/psp/psplibraries/guichan/guichanffdemo-0.7.1'
make&#58; *** &#91;psp&#93; Error 2
The weird is when I try to find these undefined symbols, like `SMPEG_new' using grep 'SMPEG_new' *.a on lib directory:

Code: Select all

fungos@Darkbrain&#58;~/dev/psp/dev/psp/lib$ grep 'SMPEG_new' *.a
Binary file libSDL_mixer.a matches
and then a nm:

Code: Select all

fungos@Darkbrain&#58;~/dev/psp/dev/psp/lib$ nm libSDL_mixer.a | grep 'SMPEG_new'
         U SMPEG_new
The symbol is from another library than SDL_mixer, but no other library has this symbol inside.

We are almost there (I hope) to get guichan working on PSP :)
Thank you again jimparis!
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

Either you need to download and port SMPEG library, or you need to configure guichan or SDL or whatever depends on it not to need it.

Jim
fungos
Posts: 41
Joined: Wed Oct 31, 2007 10:43 am
Location: cwb br
Contact:

Post by fungos »

Ok, I'm getting this problem because I'm trying to play .WAV files? Nobody never had this problem with SMPEG when using SDL_mixer?

Anyway, I ported SMPEG (I stripped out the video code) and now I reduced the errors to multiple definitions... look here:

Code: Select all

/home/fungos/dev/psp/dev/psp/lib/libSDL_mixer.a&#40;mplayer.o&#41;&#58; In function `Player_SetSynchroValue'&#58;
/home/fungos/dev/psp/psplibraries/build/SDL_mixer/mikmod/mplayer.c&#58;2908&#58; multiple definition of `Player_SetSynchroValue'
/home/fungos/dev/psp/dev/psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58;/home/fungos/dev/psp/psplibraries/build/SDL_mixer/music.c&#58;1160&#58; first defined here
/home/fungos/dev/psp/dev/psp/lib/libSDL_mixer.a&#40;mplayer.o&#41;&#58; In function `Player_GetSynchroValue'&#58;
/home/fungos/dev/psp/psplibraries/build/SDL_mixer/mikmod/mplayer.c&#58;2914&#58; multiple definition of `Player_GetSynchroValue'
/home/fungos/dev/psp/dev/psp/lib/libSDL_mixer.a&#40;music.o&#41;&#58;/home/fungos/dev/psp/psplibraries/build/SDL_mixer/music.c&#58;1166&#58; first defined here
there are the last two errors I'm getting now... we are almost there.
Thanks
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

Whether or not to use SMPEG is a configuration option for SDL_mixer - I assume everyone else turns it off.
Not sure how you fix the latest problem though. Try commenting one of them out (most likely the one in music.c), or try to work out how come the mikmod (module player) part of SDL_mixer is defining the same things as music.c.

Jim
fungos
Posts: 41
Joined: Wed Oct 31, 2007 10:43 am
Location: cwb br
Contact:

Post by fungos »

Anyway, I gave up to get guichan FF demo working with sound. I ported SMPEG and guichan. Both working on PSP (how can I commit it?).

Btw, about SDL_mixer using SMPEG (I used psplibraries to install SDL_mixer and others), I can't tell if I can disable it, I tried to see tis ./configure parameters, but It doesn't have an explicit --disable-smpeg. just one: --enable-music-mp3 (default=yes) that uses smpeg. If I disable that, how can I get mp3 played? mikmod does that?

Ok, about guichan, It's working awesome. But guichan OpenGL support doesn't work because pspgl haven't all needed functions. Anybody knows if anyone still developing pspgl?

As I said, I tested guichan FF demo on PSP, but I haven't fixed to use Joystick yet :D But looks very nice! Soon I will do it work with Joystick and put the 1.50 sample somewhere for download (btw, look my other thread about SDL and 3.xx).

Well, I'm preparing psplibraries scripts for SMPEG and guichan, so everyone can use these libs too.

Thanks again everyone that read this thread and who helped me.

EDIT:
Well, just need rebuild SDL_mixer with ./configure --enable-music-mp3=no .. But, as I already ported SMPEG. This is not necessary.

About the multiple definition.. I fixed that. music.c redefined that two functions, I think it was a macro error. there was a ifdef looking if mikmod was used then It compile that code, the correct I think, should be ifndef. I corrected and looks right now.

Someone with svn access should fix that too. Just change the #ifdef in line music.c:1156 to #ifndef.
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

If I disable that, how can I get mp3 played? mikmod does that?
If you disable it you'll need to use a different way to play mp3, mikmod will only play wavs.

Jim
Decinoge
Posts: 4
Joined: Mon Nov 12, 2007 11:28 am

Post by Decinoge »

I'm having SDL_mixer problems myself, but not on the compilation.

I cimply followed the instruction on the readme.psp and everything worked fine.

The problem i'm having is that i get no music. Even more strange is that i get sound (Mix_Chunk). the sound works perfectly. And the Music aswell, but only when compiling on Windows. When i port it to PSP, everything works as normal but i hear no sound.

I get no errors to paste and no crashes. I even "copyed" the code from the rRootage psp port, but still nuthing.

i had already tryed both .ogg and .mp3.

This is kinda frustrating :|

i'm running on a Slim with eLoader 1.0
none
cloudhunter
Posts: 86
Joined: Thu Aug 17, 2006 3:27 am

Post by cloudhunter »

Decinoge wrote:i'm running on a Slim with eLoader 1.0
Slightly off topic, but that's no way to test something you're compiling. You should compile it for 3.xx kernel, or port it to it... As that's all what the slim can natively handle.

Cloudy
:)
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

cloudhunter wrote:
Decinoge wrote:i'm running on a Slim with eLoader 1.0
Slightly off topic, but that's no way to test something you're compiling. You should compile it for 3.xx kernel, or port it to it... As that's all what the slim can natively handle.

Cloudy
Very true - there's quite a few things eLoader cannot run, so any problems COULD be eLoader, not the app.
Post Reply