J. David Bryan wrote:
The second command line doesn't include "foo.o", so the linker has no way to resolve "Bar". Try:
gcc footest.c foo.o -o footest
Thanks. There's still something wrong, but at least the error message has changed. Now I get:
foo.o: In function `Bar': foo.o(.text+0x1c): undefined reference to `_p_stdout' foo.o(.text+0x21): undefined reference to `_p_write' foo.o(.text+0x2a): undefined reference to `_p_InOutRes' foo.o(.text+0x32): undefined reference to `_p_check_inoutres' foo.o: In function `init_Foo': foo.o(.text+0x5b): undefined reference to `_p_atexit' collect2: ld returned 1 exit status
What's wrong here?