Advertising (This ad goes away for registered users. You can Login or Register)

printf with PSPLink? / Wrong link order?

Forum rules
Forum rule Nº 15 is strictly enforced in this subforum.
Post Reply
Fighter19
Posts: 9
Joined: Fri Jan 15, 2016 6:20 pm

printf with PSPLink? / Wrong link order?

Post by Fighter19 » Sat Jan 16, 2016 11:10 pm

Hi there,
So I try to port an SDL2 game, which work until now. But I want to debug it.
So I wanted my PSP to print out some messages.
When using the examples from the sdk, printf prints to the console where pspsh is open (when not using the macro which overrides printf).
But for some reason using cmake it breaks that somehow (no text appears, nothing fancy). I guess that has to do something with the order in which the libraries are linked. I wanted to ask if someone knows more about it.
My current order:
-lSDL2 -lSDL2_image -lvorbisfile -lvorbis -logg -lSDL2_mixer -lc -lpspirkeyb -lpspwlan -lpsppower -lpspvram -lGL -lfreetype -ljpeg -lpng -lz -lSDL2 -lpspgu -lpsphprm -lpspaudio -lstdc++ -lpspvfpu -lpsprtc -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel

Also tried using -Wl,--start-group no difference unfortunately.
Also I have no idea what the correct order is or how to find it out
Advertising

Fighter19
Posts: 9
Joined: Fri Jan 15, 2016 6:20 pm

Re: printf with PSPLink? / Wrong link order?

Post by Fighter19 » Sun Jan 17, 2016 11:27 am

I have found a workaround. I copied the printf and vprintf from src/libc/xprintf.c over into my header which is included in all my other files then I just added the word inline in front of it.
EDIT: Cleaning up the order in which the librariers are linked fixed the problem entirely.
Advertising

Post Reply

Return to “Programming and Security”