Re: How can I use a C-library (libXML) in an MacOS project?
- From: David Phillip Oster <oster@xxxxxxxx>
- Date: Thu, 10 Nov 2005 16:26:22 GMT
In article <op.sz0zngn9mcs9m0@phoenix>,
"Daniel Bleisteiner" <news@xxxxxxx> wrote:
> My problem is, that everything compiles just fine - but the linker doesn't
> find the library while linking. I've added the path to the accesspaths and
> there lies a libXML.dylib and libXML.la - both are not found or used!
>
> I've also tried to add those libraries to the project but I can't find a
> way to add them. Their filetype isn't supported as far as I see. But those
> are standard C libraries - can this be possible? Is there any way to
> capsule the library using another CodeWarrior project and make it
> accessible this way to the MacOS project?
>
> Please help me out... I'm stuck and I could not find any answer on this
> topic so far! Thanks!
You are working in CFM (Code Fragment Manager), and those libraries are
Mach-O. CFM and Mach-O have different conventions for organizing
libraries, and for calling functions, and for cleaning up on return.
Luckily, Apple provides some system calls to help.
Apple has sample code on doing calls from CFM to Mach-O and back. I
believe the MoreIsBetter package has some code for this, and it is
documented in a few places.
pseudocode is:
load the system library with:
FSFindFolder(kOnAppropriateDisk, kFrameworksFolderType
CFURLCreateFromFSRef
CFURLCreateCopyAppendingPathComponent
CFBundleCreate
CFBundleLoadExecutable
load individual entrypoints from the bundle using:
CFBundleGetFunctionPointerForName
and cache that value: only look it up once.
then call the function through the function pointer.
.
- Follow-Ups:
- Re: How can I use a C-library (libXML) in an MacOS project?
- From: Daniel Bleisteiner
- Re: How can I use a C-library (libXML) in an MacOS project?
- References:
- How can I use a C-library (libXML) in an MacOS project?
- From: Daniel Bleisteiner
- How can I use a C-library (libXML) in an MacOS project?
- Prev by Date: Re: How can I use a C-library (libXML) in an MacOS project?
- Next by Date: Re: How can I use a C-library (libXML) in an MacOS project?
- Previous by thread: Re: How can I use a C-library (libXML) in an MacOS project?
- Next by thread: Re: How can I use a C-library (libXML) in an MacOS project?
- Index(es):