From: <no...@so...> - 2002-05-07 10:40:46
|
Bugs item #553216, was opened at 2002-05-07 16:10 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=102435&aid=553216&group_id=2435 Category: ld Group: Feature requests Status: Open Resolution: None Priority: 5 Submitted By: Adhip Das (adhip) Assigned to: Danny Smith (dannysmith) Summary: Forward referencing problem Initial Comment: Here some simple .cxx and .h files are given. base.cxx ------- #include <stdio.h> #include "base.h" mybase :: mybase() { } mybase :: ~mybase() { } base.h ------ #ifndef _H_BASE #define _H_BASE class mybase { public: mybase(); virtual ~mybase(); }; #endif derived.cxx --------- #include <stdio.h> #include "derived.h" myderived :: myderived() : mybase() { printf("Hello\n"); } derived.h -------- #ifndef _H_DERIVED #define _H_DERIVED #include <stdio.h> #include "base.h" class myderived : public mybase { public: myderived(); virtual ~myderived() { ; } }; #endif Makefile: ------- CC = d\:/Mingw/bin/gcc.exe LD = d\:/Mingw/bin/ld.exe INCLUDE = -I. LIB = mylib.a OBJ = base.o derived.o CFLAGS = -g $(LIB) : $(OBJ) $(LD) -r -o $(LIB) $(OBJ) %.o : %.cxx $(CC) $(CFLAGS) -o $@ -c $< clean : \rm -rf *.o $(LIB) $(BIN) While building mylib.a, mingw-ld reports an error: derived.cxx:7: reloc refers to symbol `text$__tf6mybase' which is not being output But if we write in Makefile OBJ = derived.o base.o, ld doesn't report any error. The problem of reloc arises due to the option -g. Is there any way to get rid of this problem? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=102435&aid=553216&group_id=2435 |