Mail Archives: djgpp/2000/11/04/11:30:29
> From: "Paulo J. Matos aka PDestroy" <pdestroy AT netcabo DOT pt>
> Newsgroups: comp.os.msdos.djgpp
> Date: Sat, 4 Nov 2000 13:44:57 -0000
>
> One of the classes I have is a C++ template so the extension is lists.hpp
> and the header is lists.h.
> I have a makefile like the following:
> -----------------
> COBJS = x.o y.o z.o h.o p.o lists.o main.o
> PROGS = b.exe
> FLAGS = -g -Wall
> CC = gpp
>
> all: $(PROGS)
>
> banco.exe: $(COBJS)
> $(CC) $(FLAGS) -o $(PROGS) $(COBJS)
>
> clear:
> rm -f *.o
> rm -f $(PROGS)
>
> depend:
> makedepend *.cpp
> -----------
> When I try to compile the project doing make I get a problem that says:
> make.exe: *** No rule to make target `lists.o', needed by `b.exe'. Stop.
Make doesn't automatically know that lists.o can be built by compiling
lists.hpp. You need to add a rule for compiling lists.hpp into
lists.o.
Alternatively, rename lists.hpp into lists.cpp, since *.hpp files are
not meant to be compiled into object files.
Also, make sure you have the latest version 3.79.1 of GNU Make, as
older versions might not know about *.cpp files.
- Raw text -