forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Strange linking problems

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
turkeyman



Joined: 20 Oct 2004
Posts: 75
Location: Brisbane, Australia

PostPosted: Sat Jul 23, 2005 12:30 pm    Post subject: Strange linking problems Reply with quote

Code:
Linking...
../Fuji/Lib/libFuji_Debug_PSP.a(System_PSP.o): In function `loaderInit()':
System_PSP.cpp:(.text+0x60): undefined reference to `pspSdkInstallNoDeviceCheckPatch'
collect2: ld returned 1 exit status


Can anyone tell me why i might be getting this error?

heres my command line.. (not working)
psp-gcc.exe $(IntDir)/*.o ../Fuji/Lib/libFuji_$(ConfigurationName).a -LC:\cygwin\usr\local\pspdev\psp\sdk\lib -o$(TargetName).elf -lpspkernel -lpspgu -lpspusb -lpspusbstor -lstdc++ -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lc -lpspglue -lc -lpspuser

I am definately linking pspkernel, and the sample ap builds fine.. (using the pspsdk sampel ap makefile)

On an unrelated note (or maybe related, who knows) I'm getting some strange linking problems related to the order i specify libs on the command line..

I noticed this a while back, and i couldnt figure out any logic to it.. So when i had link errors, i just rearranged the order of my -l's on the command line until it links without errors...

This is just weird... Can anyone enlighten me about this weird link order logic that GCC seems to have issues with?
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
rinco



Joined: 21 Jan 2005
Posts: 255
Location: Canberra, Australia

PostPosted: Sat Jul 23, 2005 1:10 pm    Post subject: Reply with quote

i read somewhere that libs cannot depend on libs that precede them.

and once in a while there'll be a need to refer to something twice (probably a cyclic dependency), eg: -lc -lpspglue -lc

but in your case, you have missed -lpspsdk (pspSdk* functions).
Back to top
View user's profile Send private message
turkeyman



Joined: 20 Oct 2004
Posts: 75
Location: Brisbane, Australia

PostPosted: Sat Jul 23, 2005 1:22 pm    Post subject: Reply with quote

oh oops!! :P
i did too..
thanks for that! :)

sometimes these silly little things just slip by and you need a fresh pair of eyes to pick it :P

interesting with the -lc -lpspglue -lc thing.. i noticed that, and i was wondering what that was about..
i assume that GCC is intelligent enough to not double link libs then? :/

in VC if you link a lib twice, it will give a multiple definitions error..

thanks dude
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Sat Jul 23, 2005 1:39 pm    Post subject: Reply with quote

The circular dependency is a mistake I introduced, which I will be fixing shortly. The -lpspglue will also disappear so it will end up being just -lc. However, libc will still depend on -lpspuser.
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Sat Jul 23, 2005 2:12 pm    Post subject: Reply with quote

The order of linking is such that as it links in each library it will only link in the parts/functions that are required by previously specified libs. This is why you may need to specify a library more than once when two libs depend on each other.

There is a commandline option to just link in everything possible and you can later use psp-strip out the parts you don't need, but that isn't as nice. :)
Back to top
View user's profile Send private message Visit poster's website
turkeyman



Joined: 20 Oct 2004
Posts: 75
Location: Brisbane, Australia

PostPosted: Sun Jul 24, 2005 10:29 am    Post subject: Reply with quote

cool, thats interesting to know
thanks :)
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group