delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/09/28/03:10:14

From: khan AT xraylith DOT wisc DOT edu (Mumit Khan)
Subject: Re: B19: Link error between libs linked with -l
28 Sep 1998 03:10:14 -0700 :
Message-ID: <Pine.SUN.3.93.980927183551.6254B-100000.cygnus.gnu-win32@modi.xraylith.wisc.edu>
References: <360E3ED9 DOT 5EEBA9E3 AT tpu DOT org>
Mime-Version: 1.0
To: Adam Chlipala <psion AT tpu DOT org>
Cc: gnu-win32 AT cygnus DOT com

On Sun, 27 Sep 1998, Adam Chlipala wrote:

> When I do something like the following:
> gcc file.c -l1 -l2
> I get linker errors involving functions found in 1 and used in 2.  When
> I move a lib to the cwd and do:
> gcc file.c lib1.a -l2
> all is well.  Am I doing something incorrectly here or is this a bug?

When you use -l<libname>, you must also supply a -L<dirname> to tell
the linker where to find it (unless it's in one of the standard or
default directories).
  
  $ gcc file.c -L. -l1 -l2 

will fix your problem.

Mumit

-
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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019