Link Errors (C++ lib?) while porting CodeWarrior project
Link Errors (C++ lib?) while porting CodeWarrior project
- Subject: Link Errors (C++ lib?) while porting CodeWarrior project
- From: Stephen Kay <email@hidden>
- Date: Sun, 05 Aug 2012 21:50:13 -0400
- Thread-topic: Link Errors (C++ lib?) while porting CodeWarrior project
I'm porting an old CodeWarrior project to XCode finally. This is a
functioning PPC Mach-O app that already works on OS X 10.3.9 ~ 10.6.8. (PS:
if anybody is interested in a paying programming gig to help me with this
port to XCode, please reply to me.)
I am doing this initially on a PPC Mac running 10.4.11 - I've read that it
would be easier.
I'm using CodeWarrior 9.6, and eventually XCode 2.4.1 - if I get to that
point.
Right now, I'm trying to complete the steps for "Preparing a CW Project for
Importing" in Apple's "Porting CodeWarrior Projects To XCode" legacy
document.
The CW project was already a Mach-O project; however, it was linking against
MW MSL libraries. So I have completed all of the recommended steps in
removing the access paths to MSL, and getting everything pointed at the
10.3.9 SDK. I have made the {OS X Volume} in the source trees set to link
against the 10.3.9 SDK.
After working through some issues, I have gotten the project to compile all
source code, so that seems to be working. The problem is link errors.
I've removed the MSL C/C++ libraries from the project as instructed; the
document says to add "libSystem.dylib" and that you *may* need to add
crt1.o, and place it at the head of the link order list.
When I add libSystem.dylib from the usr/lib folder in the 10.3.9 SDK, it
adds libSytem.B.dylib to the project.
If I do not add crt1.o to the project, and try to link, I get a single
linker error:
Link Error : undefined: 'start' (code)
If I add crt1.o to the project, I get 21 linker errors (simplified here by
removing the file names that call them, as there are many under each error):
Link Error : undefined: 'std::exception::~exception[base]()' (imported)
Link Error : undefined: 'operator delete(void*)' (imported)
Link Error : undefined: '__cxa_vec_cleanup' (code)
Link Error : undefined: '__cxa_vec_ctor' (code)
Link Error : undefined: '__register_global_object' (code)
Link Error : undefined: '__restore_fpr_28' (code)
Link Error : undefined: '__save_fpr_28' (code)
Link Error : undefined: '__cvt_fp2unsigned' (code)
Link Error : undefined: '__div2u' (code)
Link Error : undefined: 'operator delete[](void*)' (code)
Link Error : undefined: 'operator new[](unsigned long)' (code)
Link Error : undefined: '__dynamic_cast' (code)
Link Error : undefined: 'virtual table for abi::__vmi_class_type_info'
(imported)
Link Error : undefined: '__end__catch' (code)
Link Error : undefined: '__throw' (code)
Link Error : undefined: 'std::exception::~exception[base]()' (code)
Link Error : undefined: 'virtual table for abi::__si_class_type_info'
(imported)
Link Error : undefined: 'virtual table for std::exception' (non lazy ptr
IL)
Link Error : undefined: 'operator delete(void*)' (code)
Link Error : undefined: 'virtual table for abi::__class_type_info'
(imported)
Link Error : undefined: 'operator new(unsigned long)' (code)
The weird part is that trying to link the project does not seem to matter
whether libSystem.B.dylib is in the project or not. I still get the same
linker errors with or without it - it makes no difference.
Based on the little I could find on the net, this would seem to indicate
that some or all of the c/c++ runtime libraries are not getting linked in or
located.
So I tried adding libstdc++.6.dylib (which is a symbolic link that adds
libstdc++.6.0.3.dylib). This changes things. Now, there are some warnings,
but 11 of the linker errors go away:
Link Warning : ignored 'typeinfo structure for std::exception' (data) in
libstdc++.6.dylib
Link Warning : ignored 'typeinfo name for std::exception' (data) in
libstdc++.6.dylib
Previously defined in LException.cp // this was for each of the above errors
Link Warning : ignored 'acosl' (imported) in libSystem.B.dylib
Link Warning : ignored 'asinl' (imported) in libSystem.B.dylib
Link Warning : ignored 'atan2l' (imported) in libSystem.B.dylib
Link Warning : ignored 'atanl' (imported) in libSystem.B.dylib
Link Warning : ignored 'ceill' (imported) in libSystem.B.dylib
Link Warning : ignored 'coshl' (imported) in libSystem.B.dylib
Link Warning : ignored 'cosl' (imported) in libSystem.B.dylib
Link Warning : ignored 'expl' (imported) in libSystem.B.dylib
Link Warning : ignored 'floorl' (imported) in libSystem.B.dylib
Link Warning : ignored 'fmodl' (imported) in libSystem.B.dylib
Link Warning : ignored 'frexpl' (imported) in libSystem.B.dylib
Link Warning : ignored 'hypotl' (imported) in libSystem.B.dylib
Link Warning : ignored 'ldexpl' (imported) in libSystem.B.dylib
Link Warning : ignored 'log10l' (imported) in libSystem.B.dylib
Link Warning : ignored 'logl' (imported) in libSystem.B.dylib
Link Warning : ignored 'modfl' (imported) in libSystem.B.dylib
Link Warning : ignored 'powl' (imported) in libSystem.B.dylib
Link Warning : ignored 'sinhl' (imported) in libSystem.B.dylib
Link Warning : ignored 'sinl' (imported) in libSystem.B.dylib
Link Warning : ignored 'sqrtl' (imported) in libSystem.B.dylib
Link Warning : ignored 'tanhl' (imported) in libSystem.B.dylib
Link Warning : ignored 'tanl' (imported) in libSystem.B.dylib
Previously defined in libstdc++.6.dylib // this was for each of the above
errors
Link Error : undefined: '__register_global_object' (code)
Link Error : undefined: '__restore_fpr_28' (code)
Link Error : undefined: '__save_fpr_28' (code)
Link Error : undefined: '__cvt_fp2unsigned' (code)
Link Error : undefined: '__div2u' (code)
Link Error : undefined: 'virtual table for abi::__vmi_class_type_info'
(imported)
Link Error : undefined: '__end__catch' (code)
Link Error : undefined: '__throw' (code)
Link Error : undefined: 'virtual table for abi::__si_class_type_info'
(imported)
Link Error : undefined: 'virtual table for abi::__class_type_info'
(imported)
Again, it makes no difference if libSystem.B.dylib is included or not (in
the second example); even though the above errors specifically mention it,
but it is not in the project!
I have no idea what other library might contain these functions, I tried
nearly all of them manually. I'm totally stuck here and have no idea what to
do or if I'm even going in the right direction. Any suggestions would be
greatly appreciated.
Alternately, since everything compiles and only the linking won't work,
maybe I should just move forwards with importing the project into XCode?
Thanks,
- Stephen
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Stephen Kay
Karma-Lab :: developers of KARMA
http://www.karma-lab.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden