c++ makefile problem

greerde

Member
Jun 26, 2000
49
0
0
Does anyone have any experience with makefiles in c++?
I'm getting these errors when trying to "make" my executable:
ld (prelink):
webpage.o compressed: webpage::numPages: multiply defined
webpage.o compressed: webpage::webpage(void): multiply defined
webpage.o compressed: webpage::~webpage(void): multiply defined
webpage.o compressed: webpage::readInPage(webpage*): multiply defined

i get about 100 lines of crap like that. Any ideas?
 

Rakkis

Senior member
Apr 24, 2000
841
1
0
looks like you've defined more than one function by the name "webpage" in each of those classes
 

greerde

Member
Jun 26, 2000
49
0
0
no, that isn't the problem. there is only one webpage(), that is the constructor. ~webpage() is the destructor.
 

greerde

Member
Jun 26, 2000
49
0
0
Here is my makefile:



webSearch.x: webSearch.o webpage.o wordList.o date.o url.o
cxx -w0 -std strict_ansi webSearch.o webpage.o wordList.o date.o url.o -o webSearch.x

webSearch.o: webSearch.cc webpage.h
cxx -w0 -c -std strict_ansi webSearch.cc

webpage.o: webpage.cc wordList.h date.h url.h webpage.h
cxx -w0 -c -std strict_ansi webpage.cc

wordList.o: wordList.cc wordList.h
cxx -w0 -c -std strict_ansi wordList.cc

date.o: date.cc date.h
cxx -w0 -c -std strict_ansi date.cc

url.o: url.cc url.h
cxx -w0 -c -std strict_ansi url.cc
 

fow99

Senior member
Aug 16, 2000
510
0
0
Just a guess:
you might have forgotten to wrapp up your header file with #ifndef...
so that the compiler inclueded the file more than once.