murf@CS.UTEXAS.EDU (Steve Murphy) (08/09/89)
When I get a "multiply defined" message I get way more than I bargained for, including some lies. It seems that ALL REFERENCES are listed as well as DEFINITIONS, and all are labled "defined". You should see what happens if I have multiple copies of free and malloc and realloc, on a BIG executable that used these calls a LOT. It makes it REAL HARD to sort out the problem. murf
tiemann@SUN.COM (Michael Tiemann) (01/22/90)
Here's a build which fails for reasons I understand:
cd /home2/gnu/prog2c/
time make -k
g++ -B/home2/gnu/g++/ -g -o p2 p2_CPU.o p2_ctrl.o p2_disk.o p2_disk_sched.o p2_fault.o p2_mem.o p2_proc.o p2_queue.o -L/home2/gnu/libg++/src
/home2/gnu/usr/local/lib/g++-include/BitSet.h:359: Undefined symbol BitSet::error(char *) referenced from text segment
p2_fault.c:256: Undefined symbol lg() referenced from text segment
p2_fault.c:256: Undefined symbol lg() referenced from text segment
p2_fault.c:256: Undefined symbol lg() referenced from text segment
*** Error code 1
make: Warning: Target `all' not remade because of errors
9.2 real 1.2 user 1.2 sys
Compilation finished at Mon Jan 22 07:56:07
The bug is that /home2/gnu/usr/local/lib/g++-include/BitSet.h is the
line where the reference occurs, but the linker doens't tell me the
offending .o file that it came from. When I switch my compiler
library paths, I won't know which file to recompile (without
searching). It would be nice if this error were reported like this:
in file foo.o:
...all errors of file foo.o...
in file bar.o:
...all errors of file bar.o...
etc.
Sound reasonable?
Michael