delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/08/04:13:30

From: "Maan M. Hamze" <mmhamze AT mail DOT utexas DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Linking problem
Date: 8 Jan 1997 03:13:07 GMT
Organization: University of Texas at Austin
Lines: 32
Message-ID: <01bbfd11$51d05620$96fe5380@maan-m.-hamze>
References: <5av2qk$apa AT news DOT cloud9 DOT net>
NNTP-Posting-Host: slip-78-6.ots.utexas.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Noah Levenson <noah AT cloud9 DOT net> wrote in article
<5av2qk$apa AT news DOT cloud9 DOT net>...
> I want to comple the source file "ex15.c" to "ex15.exe".  I use the
> following command line:
> 
> gcc -O -o ex15.exe ex15.c -lliballeg
> 
> liballeg.a is a library file in \lib
> 
> but it gives me a "-lliballeg: no such file" error!  If I do the
> following:

If I am not mistaken you should use:
gcc -O -o ex15.exe ex15.c -lalleg

do not inlcude the lib part with the -l switch unless..................
> 
> gcc -O -o ex15.exe ex15.c c:\djgpp\lib\liballeg.a
> it works fine.  Why can't I use the -l linking switch? 

........you use the whole name of the library which in this case is
liballeg.a,
which makes sense since you are directing the compiler into the actual
library which happens to be liballeg.a;
otherwise use -l switch with the library name stripped of the lib part and
the extension ( .a ) part.
Maan
-- 
Maan M. Hamze
mmhamze AT mail DOT utexas DOT edu
http://leb.net/~mmhamze

- Raw text -


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