Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Shared Libraries on Mac OS X
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shared Libraries on Mac OS X



Oops - I answered from the wrong mailing list...

On Dec 13, 2007, at 3:37 PM, Tim Jones wrote:

On Dec 13, 2007, at 3:17 PM, Daniel Corbe wrote:

I'm trying to do something extremely simple and I don't understand why it isn't working on my mac. It's actually quite infuriating to me that gcc isn't behaving like it should be.

daniel-corbes-computer:cnamd dcorbe$ gcc -fPIC -c testmodule.c -o testmodule.o
daniel-corbes-computer:cnamd dcorbe$ gcc -shared -o libtestmodule.so testmodule.o

Try simply creating the shared lib as a single step:

gcc -fPIC -shared testmodule.c -o libtestmodule.so

That was for Linux (as Jordan noted). Your original mail got mixed into my Linux lists. For OS X, that command would be:


	gcc -dynamiclib testmodule.c -o libtestmodules.dylib

However, note that it's a single command in this example. You don't need to create the intermediary .o file.

Sorry for the confusion.

Tim

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Unix-porting mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Shared Libraries on Mac OS X (From: "Daniel Corbe" <email@hidden>)
 >Re: Shared Libraries on Mac OS X (From: Tim Jones <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.