Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
C dynamic libraries with mac os x
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="piedro" data-source="post: 56201"><p>Hello</p><p>I'm a new mac user (I'm actually more used to work under unix, even though I'm far from being an expert).</p><p>I would like to export some programs developped under linux to my mac, and I'm facing some problems.</p><p>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 <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /> ) that easy.</p><p>In brief I want to create a shared libraries from c files. </p><p></p><p>For instance if I consider 2 C files in linux, I create the library by :</p><p> - gcc -fPIC -c prog1.c</p><p> - gcc -fPIC -c prog2.c</p><p> - gcc -shared -o libProg.so prog1.o prog2.o</p><p>Then I just need to include libProg.so in my LD_LIBRARY_PATH, and the headers prog1.h and prog2.h in my PATH.</p><p></p><p>The problem with mac os X is that the -shared option can't be used...</p><p>I guess the process is rather simple but I think I'll appreciate some help (please!!!!!).</p><p></p><p>Thanks to the people who'll read this until the end...and thanks a lot to those who'll accept helping me!</p><p></p><p></p><p>Pierre</p></blockquote><p></p>
[QUOTE="piedro, post: 56201"] 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]
Verification
Name this item 🌈
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
C dynamic libraries with mac os x
Top