This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ld -shared



> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]