Mail Archives: cygwin/1997/12/31/22:49:30
On 31-Dec-1997, Martin 'EmmEss' Svenningsson <emmess AT bml DOT rmv DOT se DOT org> wrote:
> I may be a bit lame, but how do I link other libs in my DLL's? (non-reloc)
Just add the approproate `-lfoo -lbar' options to the link line when
creating your DLL; they should go after the `.o' files but before any
`-l' options for system libraries (e.g. `-lkernel32').
If you're using my Makefile.DLLs, put these in the LDLIBS variable
(or, if you are buidling multiple DLLs in the same directory, you can
use the variables LDLIBS-foo and LDLIBS-bar).
> I've tried ld foo.dll foo.exp foo.o C:\pathtolibs\libbar.a, but it doesn't
> seem to work.
Well, that would need to be
ld --dll -o foo.dll foo.exp foo.o ...
^^^^^^^^
Also depending on which shell you're using, you may need to
escape the \ characters or use Unix-style pathnames
(e.g. //c/pathtolibs/libbar.a).
In addition, I think you'll need to specify `-lkernel32' etc.
Furthermore, I think cygwin.dll doesn't work if it gets relocated;
this may be more likely if you're trying to link with multiple DLLs.
If your program links fine but won't run, then try running your program
under gdb -- this will give you some information about what's happening
with DLLs.
--
Fergus Henderson <fjh AT cs DOT mu DOT oz DOT au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh AT 128 DOT 250 DOT 37 DOT 3 | -- the last words of T. S. Garp.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -