public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Daney <ddaney@avtrex.com>
To: Matthew Woehlke <mw_triad@users.sourceforge.net>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Doc is misleading
Date: Thu, 10 May 2007 18:36:00 -0000	[thread overview]
Message-ID: <46436639.6060002@avtrex.com> (raw)
In-Reply-To: <f1vo5v$bt8$1@sea.gmane.org>

Matthew Woehlke wrote:
> gccNewbie wrote:
>> Matthew Woehlke-3 wrote:
>>> Linux lets you get away with this wrong link order due to lazy symbol 
>>> resolution, whereas Windows does not. What you have done is asked to 
>>> first link to libmylib. Since no objects (actually, you don't *have* 
>>> any objects yet!) require any symbols from libmylib, no symbols are 
>>> imported. 
>>
>> That solved my problem very well! I should have tried that, but it's even
>> better to have this explanation of why it works.
> 
> Glad it was helpful! :-)
> 
>> It's odd that the manual was so deliberately misleading on this! While 
>> I was
>> trying to solve this myself, I read: "You can mix options and other
>> arguments. For the most part, the order you use doesn't matter. Order 
>> does
>> matter when you use several options of the same kind; for example, if you
>> specify -L more than once, the directories are searched in the order
>> specified."
> 
> Eeeeeeeh... *technically* it isn't wrong (you can mix -W, -f options, 
> for example) but I see why it confused you, and I agree that it *really* 
> ought to say something about -l being in the 'order can matter' 
> category. You are by no means the first person on Windows to get bitten 
> by this.
> 
> To whoever maintains the doc: we really should add something like "Note 
> that the order of objects, including libraries specified by -l, DOES 
> matter on some platforms.", perhaps with an even longer explanation as 
> well such as what was in my previous post.

Perhaps reading this would be helpful:

http://sourceware.org/binutils/docs-2.17/ld/Options.html

I think it explains how it works.

David Daney

  reply	other threads:[~2007-05-10 18:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-10 11:00 Simple linking problem gccNewbie
2007-05-10 11:07 ` Andrew Haley
2007-05-10 11:38   ` gccNewbie
2007-05-10 11:40     ` John (Eljay) Love-Jensen
2007-05-10 11:42     ` Andrew Haley
2007-05-10 16:00     ` Matthew Woehlke
2007-05-10 18:18       ` gccNewbie
2007-05-10 18:27         ` Doc is misleading (was: Simple linking problem) Matthew Woehlke
2007-05-10 18:36           ` David Daney [this message]
2007-05-10 19:08             ` Doc is misleading Matthew Woehlke
2007-05-23 16:04               ` Ian Lance Taylor
2007-05-23 21:45                 ` Matthew Woehlke

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=46436639.6060002@avtrex.com \
    --to=ddaney@avtrex.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=mw_triad@users.sourceforge.net \
    /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).