public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "John \(Eljay\) Love-Jensen" <eljay@adobe.com>
To: "gccNewbie" <bguild@shaw.ca>, <gcc-help@gcc.gnu.org>
Subject: RE: Simple linking problem
Date: Thu, 10 May 2007 11:40:00 -0000	[thread overview]
Message-ID: <EDC8DDD212FEB34C884CBB0EE8EC2D9103B25BF2@namailgen.corp.adobe.com> (raw)
In-Reply-To: <10411665.post@talk.nabble.com>

Hi gccNewbie,

>So it is really a very simple riddle. 'gcc -lmylib mysource.c' uses a function 'foo' which nm shows is defined in libmylib.a. gcc does not complain about not being able to find mylib, but it does complain that 'foo' is an 'undefined reference'. In what situation could that happen?

Dependency order is important.

What happens when you do:

gcc mysource.c -lmylib

HTH,
--Eljay

  reply	other threads:[~2007-05-10 11:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-10 11:00 gccNewbie
2007-05-10 11:07 ` Andrew Haley
2007-05-10 11:38   ` gccNewbie
2007-05-10 11:40     ` John (Eljay) Love-Jensen [this message]
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           ` Doc is misleading David Daney
2007-05-10 19:08             ` 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=EDC8DDD212FEB34C884CBB0EE8EC2D9103B25BF2@namailgen.corp.adobe.com \
    --to=eljay@adobe.com \
    --cc=bguild@shaw.ca \
    --cc=gcc-help@gcc.gnu.org \
    /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).