public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Fergus Henderson <fjh@cs.mu.OZ.AU>
To: Joao Pedro Sousa <js@servisoft.pt>
Cc: gnu-win32@cygnus.com
Subject: Re: Linking with -lkernel32 [was: Re: beta18: building gdb gives incomplete import table [and other problems]???]
Date: Wed, 31 Dec 1997 21:16:00 -0000	[thread overview]
Message-ID: <19980101161636.43667@mundook.cs.mu.OZ.AU> (raw)
In-Reply-To: <3.0.5.32.19971231153549.0079dc70@mail.servisoft.pt>

On 31-Dec-1997, Joao Pedro Sousa <js@servisoft.pt> wrote:
> At 12:34 31-12-1997 +1100, Fergus Henderson wrote:
> >...
> >One bug with the linker that has been mentioned on this list previously
> >is that if the same library name is mentioned twice on the link line,
> >then the linker generates executables that crash.  `-lkernel32' is
> >linked in by default, so if you mention it explicitly then it will
> >get linked in twice, causing the symptoms you observed.
> I can't successfully link DLLs (relocatable or non-relocatable) if I don't
> include:
>    -lc -lcygwin -lkernel32 -lc

Whether or not you need to specify `-lkernel32' etc. explicitly
depends on whether you are using `gcc' to do the link, or whether
you are invoking `ld' directly.  If you're using `gcc' to do the link,
it will pass `-lkernel32' etc., so you don't need to (and in fact must not)
specify it yourself.  If you're invoking `ld' directly, then yes you
do need to specify it explicitly.

> If I understand correctly, you use "-lgcc -lcygwin -lkernel32 -lgcc" among
> other obvious things.
> So, should we, or should we not repeat libs?

I think repeating ordinary libraries (e.g. `-lgcc') is OK;
I think it is only DLL import libraries (e.g. `-lcygwin' or `-lkernel32')
that cause problems if they are linked twice.
(However, this is basically just educated guesswork.)

-- 
Fergus Henderson <fjh@cs.mu.oz.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@128.250.37.3         |     -- the last words of T. S. Garp.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

  reply	other threads:[~1997-12-31 21:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-12-28 22:19 beta18: building gdb gives incomplete import table??? Steven Reddie
1997-12-29 15:44 ` beta18: building gdb gives incomplete import table [and other problems]??? Steven Reddie
1997-12-30 17:34   ` Fergus Henderson
1997-12-31  7:33     ` Linking with -lkernel32 [was: Re: beta18: building gdb gives incomplete import table [and other problems]???] Joao Pedro Sousa
1997-12-31 21:16       ` Fergus Henderson [this message]
1998-01-05  7:54 marcus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19980101161636.43667@mundook.cs.mu.OZ.AU \
    --to=fjh@cs.mu.oz.au \
    --cc=gnu-win32@cygnus.com \
    --cc=js@servisoft.pt \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).