Mail Archives: djgpp/1999/06/07/09:20:45
In a message dated 6/7/99 6:10:33 AM EST, eliz AT is DOT elta DOT co DOT il writes:
> Like I said, post the details: the Makefile fragment that should invoke
> the compiler and the error message(s) printed when you run it. It is
> impossible to debug such problems without seeing this stuff.
bash-2.02$ make -f makefile.dj
g++ -O2 main.cpp raster_analysis.o random_raster.o reduce.o -o
raster_reduce.exe -lm
g++: raster_analysis.o: No such file or directory
g++: random_raster.o: No such file or directory
g++: reduce.o: No such file or directory
make: *** [raster_reduce.exe] Error 1
-----------------------------------
The makefile which works if all file extensions are .c
CC = g++
CFLAGS = -O2
LFLAGS =
RANLIB = ranlib
INCLUDE = raster_analysis.h reduce.h
LIBS = -lm
OBJS = raster_analysis.o random_raster.o reduce.o
.SUFFIXES= .cpp
all: raster_reduce.exe
raster_reduce.exe: $(OBJS) $(INCLUDE) main.cpp
$(CC) $(CFLAGS) main.cpp $(OBJS) $(LFLAGS) -o raster_reduce.exe
$(LIBS)
.c.o:
$(CC) $(CFLAGS) -c $*.c
$(OBJS) :$(INCLUDE)
clean:
rm -f *.o raster_reduce.exe
------------------------------------------------
I also tried to use CPP instead of CC, CPPFLAGS instead of CFLAGS, and
modified the build rule
.c.o:
$(CC) $(CFLAGS) -c $*.c
to use .cpp. I was not able to get it working probably because I am missing
another instruction.
I verified make -p does not include .cpp in SUFFIXES. EXT does though. I
also verified I have
g++.exe installed. I installed cygwin, the latest version, last week. I
believe the kit should be failrly complete.
Best
Mohamed
- Raw text -