delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/20/21:17:06

Mime-Version: 1.0
To: Charles Terry <cterry AT plinet DOT com>, djgpp AT delorie DOT com
From: Nate Eldredge <nate AT cartsys DOT com>
Subject: Re: Unresolved externals
Date: Mon, 20 Apr 1998 18:11:31 -0700
Message-ID: <19980421011110.AAG9311@ppp124.cartsys.com>

At 08:21  4/19/1998 -0700, Charles Terry wrote:

>BTW I don't think I could run the program as the linker 
>reported the unresolve linkage as an error, not a warning.
>Is that right?

Yes, that's right. IMHO, it *is* an error. What else is the linker to do--
replace the reference with a 0 and let the program segfault? It's only in
the case of DLL's and such that this can't be done.

>Also, is there a utility other than CASE tools or such that would
>peform the check described above?

You mean, to see what unresolved externals exist from a library? Sure. You
can do this:

nm -ugA libfoo.a |cut -d : -f 3- |sort |uniq >undef
nm --defined-only -gA libfoo.a |cut -d " " -f 3- |sort |uniq >def
comm undef def -2 -3

Notes:
 Assumes the library is called libfoo.a
 Assumes you have Textutils installed
 If `sort' doesn't work, be sure you are using the one from DJGPP, not DOS.
(If you don't want to change your path, try
   cd \djgpp\bin
   ln -s sort.exe gsort.exe
and using `gsort' instead of `sort' above.

HTH

Nate Eldredge
nate AT cartsys DOT com



dredge
nate AT cartsys DOT com



- Raw text -


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