Should I be building a static or dynamic library?
Should I be building a static or dynamic library?
- Subject: Should I be building a static or dynamic library?
- From: Stephen Kay <email@hidden>
- Date: Sun, 12 Aug 2012 16:41:36 -0400
- Thread-topic: Should I be building a static or dynamic library?
I have two related older CodeWarrior projects I'm porting to Xcode. Using
Xcode 2.4.1 and OS X 10.4.11 to initially get it ported over.
One of the projects is a library that is included by the other "parent"
project. I'm not sure if it is supposed to be a static or dynamic library.
In the original CodeWarrior Project, the Project Type is "Library" with
Addressing Mode set to "dynamic-plc".
After importing into Xcode, the Projects Inspector > Build > Mach O Type is
set to "Static Library". Is this correct? (Seems wrong...because...)
According to what I've read, if it is a static library, it should have the
suffix ".a". So I set it to that, and it successfully creates libMyLibrary.a
(example).
In the parent project, I've included libMyLibrary.a, and in the inspector
for the library, set the File Type to "archive".
But in the Target's Build Phase "Link Binary With Libraries", when you try
to build this, it gives the error:
warning: skipping file 'foofoo/libMyLibrary.a' (unexpected file type
'archive' in Frameworks & Libraries build phase)
So I tried, for the heck of it, setting the library project to build
a Dynamic Library, with the extension .dylib. I changed the parent project
to include this dylib into the target, with a File Type of
"compiled.mach-o.dylib" - and this seems to work (although I'm still dealing
with some undefined symbols). But now I'm actually getting somewhere.
I just want to verify that this is indeed the way to be proceeding, and that
the import procedure didn't correctly handle the situation.
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