Mail Archives: djgpp/1999/11/07/12:23:54
Alexander Russell (alexad3 AT uniserve DOT com) wrote:
: the make file:
: ---------------
: CC = gcc
: link = ld
: CFLAGS = -O -c
: LFLAGS = -Lc:\\djgpp\\lib c:\\djgpp\\lib\\crt0.o
: LFLAGS2 = -lm -lc -lgcc -o
: OBJECTS = database.o crossw.o words.o
: TARGET = CROSSW.EXE
: $(TARGET) : $(OBJECTS)
: $(link) $(LFLAGS) $(OBJECTS) $(LFLAGS2) $(TARGET)
: %.o : %.cpp
: $(CC) $(CFLAGS) $<
: -------------
: the error
: ld -Lc:\\djgpp\\lib c:\\djgpp\\lib\\crt0.o database.o crossw.o
: words.o -lm -lc -
: lgcc -o CROSSW.EXE
: c:\djgpp\lib/libgcc.a(_new_handler.o): In function `__default_new_handler':
: libgcc2.c(.text+0x4d): undefined reference to `write'
: make.exe: *** [CROSSW.EXE] Error 1
: Am I missing a lib in the link line? Wrong order?
: The code uses fprintf, putc, putch fwrite, fopen, fclose
: Installed djgpp from:
: bnu281b.zip
: djdev202.zip
: gcc281.zip
: gpp281b.zip
: Thanks for any help, clues.
1. Try letting gpp (or gxx) do the linking: "link = gpp
LFLAGS =
LFLAGS2 = " and see if it works. If it does, add "-v" to the flags
to see how gcc handled the order of libraries.
2. Why do you not use "-O2" for optimisation?
Oldfield, QE2,
MartinS
- Raw text -