Mail Archives: djgpp/1998/04/20/21:17:06
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 -