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 

Problems with linking to own static libs

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



Joined: 25 Nov 2006
Posts: 23

PostPosted: Fri Dec 28, 2007 6:47 am    Post subject: Problems with linking to own static libs Reply with quote

I've had some errors thrown up by some of my own static libs during linking. At first, I thought it was something screwy with my use of rtti and templates, but it appears that my own static libs have problems linking to the sdk static libs.

Does anybody have any idea as to why this would be?
Back to top
View user's profile Send private message
IronAvatar



Joined: 25 Nov 2006
Posts: 23

PostPosted: Fri Dec 28, 2007 8:20 am    Post subject: Reply with quote

I've resolved most of the link issues by munging all of the cpp files used to generate the libs into the exe. I guess the majority of those were due to link order (the one thig I hate about gcc based tool-chains).

But the problem remains that I'm getting a link error with the vtables of a few classes, which use some templates to wrap around a custom rtti system.

So yet again, any ideas anybody?
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Sat Dec 29, 2007 6:35 am    Post subject: Reply with quote

Our crystal ball is cloudy, and so we have no clue what your errors say.
So don't expect much of a useful answer.
But clearly if you're having link-order problems, you should read the many many threads that have been posted on the same topic, and use -Wl,--start-group for starters.
Back to top
View user's profile Send private message
IronAvatar



Joined: 25 Nov 2006
Posts: 23

PostPosted: Sat Dec 29, 2007 7:32 am    Post subject: Reply with quote

Hah. I almost had a snipy reply, but youre perfectly correct.

The link errors that I'm getting are

Code:

../../../Magma/obj/psp/release/Core/MgObject.o:(.rodata._ZTIN6MgCore6IClassINS_7CObjectENS_11CNullObjectEEE[typeinfo for MgCore::IClass<MgCore::CObject, MgCore::CNullObject>]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
../../../Magma/obj/psp/release/Core/MgObject.o:(.rodata._ZTIN6MgCore11CNullObjectE[typeinfo for MgCore::CNullObject]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
../../../Magma/obj/psp/release/Render/MgCamera.o:(.rodata._ZTIN8MgRender7CCameraE[typeinfo for MgRender::CCamera]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'

../../../Magma/obj/psp/release/Render/MgCamera.o:(.rodata._ZTIN6MgCore6IClassIN8MgRender7CCameraENS_7CObjectEEE[typeinfo for MgCore::IClass<MgRender::CCamera, MgCore::CObject>]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'

../../../Magma/obj/psp/release/Render/psp/MgRenderManagerPsp.o:(.rodata._ZTIN8MgRender17CRenderManagerPspE[typeinfo for MgRender::CRenderManagerPsp]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'


I've done as you've ordered, I mean, suggested and done a quick look on the link order issue which I guess makes perfect sense now that I think about it. I may just try and tell the linker to link in everything and rely on psp-strip to remove anything that isn't used.

All I have to do after that is figure out get rid of the rtti related link errors. I have a feeling that it might be because I'm not linking in the C++ std lib though.
Back to top
View user's profile Send private message
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