C++ compiler/make error - Undefined symbols, ld returned 1 exit status
c.readFile(indexWordsFilename); // error!
Undefined symbols:
“Concordance::readFile(char*)”, referenced from:
_main in concordanceMain.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-MacOSX/cs225concordance] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
basically showed up because in the class definition file Concordance.cpp there wasn’t a scope resolution thing next to the definition of the method:
vector<string>* readFile(char *fileName) {…} should be:
vector<string>* Concordance::readFile(char *fileName) {…}