| View previous topic :: View next topic |
| Author |
Message |
IronAvatar
Joined: 25 Nov 2006 Posts: 23
|
Posted: Fri Dec 28, 2007 6:47 am Post subject: Problems with linking to own static libs |
|
|
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 |
|
 |
IronAvatar
Joined: 25 Nov 2006 Posts: 23
|
Posted: Fri Dec 28, 2007 8:20 am Post subject: |
|
|
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 |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Sat Dec 29, 2007 6:35 am Post subject: |
|
|
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 |
|
 |
IronAvatar
Joined: 25 Nov 2006 Posts: 23
|
Posted: Sat Dec 29, 2007 7:32 am Post subject: |
|
|
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 |
|
 |
|