|
#1
| ||||
| ||||
|
how to build a shared object in OSX hello, this question comes in two flavors: 1. how do i normally implement something like shared objects with project buider mac os x 10.1? is that a library or a framework or ...??? 2. how do i create a shared object on the command line using cc? i'm working on a project that has been developed on linux/solaris and has some quite sophisticated makefiles. can modify and keep them? i' currently stuck because good ol'"cc -shared libacl.so ..." doesn't work. the compiler is complaining because main is not defined. thanks jochen |
|
#2
| |||
| |||
| Porting Tips ...
Head over to http://gnu-darwin.sourceforge.net/porting.html ... they provide tips for porting programs over to darwin. One of the tips is how to create dummy libraries for those you are missing ... It doesn't cover shared libraries, but there's enough there to get you started and point you in the right direction. You can probably also ask on their mailing list how you might go about doing shared libaries. Good Luck, __nether |
|
#3
| |||
| |||
| Part two :)
Hey missed some of the answers. Answer 1: It depends on your application ... What do you want to do with it? Should it be portable? If so, it should be a unix style shared library. If it's just for OS X, then a framework will be better.Answer 2: See my post above. In addition: When you compile a large program (and libraries in your case), you need to first compile the object files, then link then. When you do a straight cc, you are telling the compiler to both compile and link then. What you want to do is in CFLAGS, add a -c (and also probably -no-cpp-precompile). You might also need to do -flat_namespace and quite possibly -traditional_cpp. Take a look at the release notes of Project Builder. __nether |
|
#4
| ||||
| ||||
| with the following line: does it
thanks for your reply and the link to sourceforge. i solved my problem
|
|
#5
| ||||
| ||||
|
i looked it up in a makefile. you have to compile the sources with the flag -dynamic and then rename the object files in mylib.so many thanx couzteau |
|
#6
| ||||
| ||||
|
replace the compiler option -shared to build a shared lib with -dynamiclib. the object files that are used to build the shared object have to be compiled with -fno_commons as gcc flag to avoid namespaceproblems. |
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Trying to build MING for OSX - Anyone did the module? | snipper | Mac OS X System & Mac Software | 1 | December 18th, 2005 03:12 PM |
| how to build a shared object in OSX | couzteau | Software Programming & Web Scripting | 1 | January 13th, 2002 04:27 PM |
| Will the current build update osx Server? | Dotman | Apple News, Rumors & Discussion | 2 | September 25th, 2001 08:06 PM |