New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

C dynamic libraries with mac os x


Post Reply New Thread Subscribe

 
Thread Tools
piedro
Guest
 
Posts: n/a

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
QUOTE Thanks
miggles

 
Member Since: Aug 03, 2004
Posts: 39
miggles is on a distinguished road

miggles is offline
piedro, you need to be using ``libtool -dynamic'' to build the .so files.
QUOTE Thanks

Post Reply New Thread Subscribe


« ipfw config file? | [ANN] New comprehensive AppleScript book »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Mac Songs The mac 13 Switcher Hangout 7 05-06-2010 12:35 AM
pc to mac.. now back to pc.. my g5 1.6 biggest headache! dankim723 Apple Desktops 25 05-14-2005 11:05 AM
It's called a Mac iSheep Schweb's Lounge 22 10-13-2004 05:35 PM
Mac Users Get More ISP Choices schweb Apple Rumors and Reports 1 03-06-2003 10:57 AM

All times are GMT -4. The time now is 11:42 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?