ld -shared

DJ Delorie dj@delorie.com
Fri May 26 09:32:00 GMT 2000


> Is the -shared option to ld supported?. 

Yes, but it creates DLLs not shared libraries.

> ld -shared a.o -o liba.so
> 
> But when I try this on cygwin I get an unresolved reference to b -
> exactly as if the shared option is ignored.

You have to link against an import library that defines where b comes
from.  DLLs work differently than shared libraries.  You'll end up with
something like this:

  ld -shared a.o libb.a -o a.dll

where libb.a is the import library for, say, b.dll

Try "ld --help" for a full list of options; the DLL-specific ones are
at the end.  --out-implib and --export-all-symbols will probably be
useful to you.

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list