I have an object file, which I'd like to make into a Mach-O binary(I'm on Mac OS 10.6). Running ld -e _main source.o /usr/lib/libc.dylib produces the following output:
ld: symbol dyld_stub_binding_helper not defined (usually in crt1.o/dylib1.o/bundle1.o) for inferred architecture x86_64
How can I reference libc using ld?
You'll need to add to the ld invocation the libraries that your object file calls to -- in static or dynamic form. For printf, in particular, I think you want /usr/lib/libc.dylib.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With