Dynamic Linked Libraries under MacOS?

Adriaan van Os gpc at microbizz.nl
Wed Apr 23 12:21:55 CEST 2003

The runtime architecture of Mac OS X is rather complex. GPC produces  
Mach-O type files, the native format for Darwin, the Mac OS kernel. For  
compatibility, Mac OS X also recognizes CFM/PEF type object files, the  
format used in Mac OS 8 and 9.

Mach-O has intermediate object files (.o), static libraries (.a),  
dynamically linked shared libraries (.dylib), kernel extensions  
(.kext), loadable Mach-O bundles, dynamically linked shared libraries  
packaged into bundles (.bundle), dynamically linked shared libraries  
packaged into frameworks (.framework), Mach-O command-line executables  
and Mach-O GUI executables bundled into application packages (.app),  
other formats as well. For complete information, study  

In regular application development you don't need detailed knowledge of  
this all, as the linker "ld" together with the dynamic loader take care  
of everything. You need a GPC interface file, as usual, plus a library  
to link with. GPCs --automake feature doesn't know about Mac OS X  
frameworks, but you can pass that information directly to the linker,  
e.g. to link to Apple's "Carbon" framework:

   gpc --automake -Wl,-framework,Carbon -o SillyBalls SillyBalls.pas

Things become more difficult, if you want to such things as building  
dynamically linked shared libraries, bundles, frameworks or calling  
Mach-O code from CFM/PEF. This will be covered in examples I am  
currently working on.

Is there any specific problem you want to solve ?


Adriaan van Os

More information about the Gpc mailing list