On Feb 10, 2005, at 3:28 PM, Luc Vandal wrote: is there anything to do in particular to export functions from a bsd static library? If so, could anyone tell me what to do?
All symbols not declared 'static' will be exported by default. There's nothing you need to do.
If you want to restrict what's exported, there are two techniques.
The first technique is to declare individual symbols as private to the library but external to the current file using the __private_extern__ keyword. This keyword can be used in the same places you would use either the static or extern keywords.
The second technique is to use an export list. This is a file (usually ending in the extension .exp) that contains a list of the symbols to export, one per line (\n terminated). Create this file, then choose the target, choose Get Info, click the Build tab, pull down the column header in the first column to the Linking collection, and find the Exported Symbols File build setting; set that to the name of your .exp file. On the next build, only the symbols in that file will be exported in your built library.
To get a start on building an .exp file, nm -gj <file> | sort | uniq will give you a list of all exports from your library.
Chris |