> But now when I go to link I get these weird errors about undefined  
> symbols in a function that they are not even related to.

Yes, the linker is being weird or at least misleading when it
reports undefined symbols:

> simplelang: np: not defined
> simplelang: apm: not defined
> simplelang: gdt: not defined

It is telling you which procedure it was processing when it detected
the error, not necessarily which procedure was responsible for the
error.  Because it is not known which symbols are undefined until all
object files have been seen, the "not defined" messages are all labelled
with the last procedure of the last object file to be processed.

You can get more useful information by doing something like:

term%  nm *.8 ../port/*.a | grep ' ((np)|(apm)|(gdt))$'
gdt.8: d gdt
onlyin.8: U apm
onlyin.8: U gdt
onlyin.8: U np

This tells you that gdt is actually there but it's been declared as
a static (local) label; and np and apm are referenced in onlyin.8
but not defined anywhere.


Reply via email to