Building a C library Objective-C wrapper framework
Building a C library Objective-C wrapper framework
- Subject: Building a C library Objective-C wrapper framework
- From: Sebastian Nowicki <email@hidden>
- Date: Mon, 14 Jul 2008 17:00:50 +0800
Hi,
I'm writing a framework that basically provides an OOP wrapper around
a C library (used mainly on linux). I need to build this framework
with the C library properly linked. I'm not exactly sure how to do it.
Currently I have it as an SDK, and just included the compiled .dylib,
and header files in it. It builds fine, but I'm not able to use the
framework in an application. What happens is that I try to #import
<MyFramework/MyFramework.h>, and gcc complains that it can't find
theclib.h. "theclib.h" is found in MyFramework/Headers/theclib.h, but
it's of course only looking in the default header search paths. I
expect that even if I get this header problem solved, it won't be able
to actually link against the framework.
I'd like some guidance on how to go about doing this properly. I'm
obviously not setting the install_path right - I'm completely confused
about that. Basically I want to create a framework that completely
encapsulates (so that it's transparent to the user) the C library, and
its depending libraries. All the developer using the framework should
have to do is "#import <MyFramework/MyFramework.h>" and link against
the framework - just like other Apple frameworks. I looked into Adium
code, since that's the first open source application that comes to
mind which does a similar thing (with libpurple). It appears they made
a libpurple.framework. Would it be a good idea for me to create a
theclib.framework and then link MyFramework.framework against
theclib.framework? How are the install_paths supposed to be setup?
Here's a bit of a "dependency" graph:
MyFramework -> theclib
theclib -> dependantlibA
theclib -> dependantlibB
theclib.framework would therefore have to encapsulate dependantlibA
and dependantlibB. MyFramework.framework would have to encapsulate
theclib.framework.
I come from a linux background so this is really confusing for me. On
linux I just compile against the lib with the assumption that the lib
will constantly stay in that place - plain and simple.
I wasn't sure if I was to post this here or some other mailing list,
so sorry if it's the wrong one.Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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