Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: making dynamic libraries with gcc



> Hello,
> In trying to port a large library to OS X, we would like to learn how
> to create a dynamically loadable library (a .dylib object) with gcc on
> darwin.  The documentation on Apple's site all assumes we're using
> XCode, but we are using our own build system.
> Given a file foo.c, with several functions defined in it, how to create
> a foo.dylib file that can be used as argument to dlopen()?  Thanks.

This may help:
http://developer.apple.com/technotes/tn2002/tn2071.html

I think basically you do this:
gcc -c foo.c
ld -dynamiclib -install_name libfoo.dylib -o libfoo.dylib foo.o

Drew McCormack
_______________________________________________
scitech mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/scitech
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.