Creating shared objects (dylibs)

X

xwasp

Guest
On OS X 10.3.9, I can create shared objects using the
following commands:

Code:
cc -fPIC -c -o file1.o file1.c
cc -fPIC -c -o file2.o file2.c
cc -fPIC -c -o file3.o file3.c
libtool -dynamic -o libfile.dylib file1.o file2.o file3.o -lc

However, on any version of OS X 10.4, this fails with a linker
error:

Code:
ld: for architecture ppc
ld: Undefined symbols:
_printf$LDBLStub
libtool: internal link edit command failed

Any ideas?
 
Joined
Jun 25, 2005
Messages
3,231
Reaction score
112
Points
63
Location
On the road
Your Mac's Specs
2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
xwasp said:
libtool -dynamic -o libfile.dylib file1.o file2.o file3.o -lc
Try changing the line to;
libtool -dynamic -lSystemStubs -o libfile.dylib file1.o file2.o file3.o -lc

I found that answer from Apple's macosx-dev list dated October 28, 2005.
 
OP
X

xwasp

Guest
Thanks. I'll give it to my friend to try tonight.

A generic google search was most unhelpful. I'll check the
Apple lists in future.
 

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