C dynamic libraries with mac os x

P

piedro

Guest
Hello
I'm a new mac user (I'm actually more used to work under unix, even though I'm far from being an expert).
I would like to export some programs developped under linux to my mac, and I'm facing some problems.
The problem itself seems rather simple...but since I don't have any background knowledge about how mac works, the task is not (at least for me :) ) that easy.
In brief I want to create a shared libraries from c files.

For instance if I consider 2 C files in linux, I create the library by :
- gcc -fPIC -c prog1.c
- gcc -fPIC -c prog2.c
- gcc -shared -o libProg.so prog1.o prog2.o
Then I just need to include libProg.so in my LD_LIBRARY_PATH, and the headers prog1.h and prog2.h in my PATH.

The problem with mac os X is that the -shared option can't be used...
I guess the process is rather simple but I think I'll appreciate some help (please!!!!!).

Thanks to the people who'll read this until the end...and thanks a lot to those who'll accept helping me!


Pierre
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top