views:

337

answers:

0

Hi, I want to create a plain BSD library in Mac OS X which provides a plan C wrapper for Objective-C bases system APIs (like the CoreLocation API).

Although I've written and gotten this to compile, it won't load from DLOpen in other programs. I used the "Cocoa library" project type, because when I used the normal "BSD Library" project type, the Objective-C code refused to compile.

The output of the nm command shows what I would expect, however:

nm -gm libcll.dylib
000000000000158e (__TEXT,__text) external __LocationManagerLatGet
00000000000015a3 (__TEXT,__text) external __LocationManagerLonGet
0000000000001536 (__TEXT,__text) external __LocationManagerStart
0000000000001562 (__TEXT,__text) external __LocationManagerStop

(The above API is obviously simplistic, and just a starter for testing).

If anyone has a sample of a shared library wrapping Objective-C code in plain C for XCode, let me know. (I know something like this was done in Kylix, for example, since QT had only a C++ API and it was necessary to convert it to C to access it from other compilers).