hi i use cyqwin machine and i am new in linux. i can not compile a code i ran into these errors:
ngram-count.o:ngram-count.cc: (.text+0xa9): undefined reference to `_Opt_Parse'
ngram-count.o:ngram-count.cc: (.text+0x11f): undefined reference to `Vocab::Vocab(unsigned int, unsigned int)'
ngram-count.o:ngram-count.cc: (.text+0x204): undefined reference to `SubVocab::SubVocab(Vocab&)'
ngram-count.o:ngram-count.cc: (.text+0x245): undefined reference to `StopNgramStats::StopNgramStats(Vocab&, SubVocab&, unsigned int)'
ngram-count.o:ngram-count.cc: (.text+0x2b5): undefined reference to `File::File(char const*, char const*, int)'
ngram-count.o:ngram-count.cc: (.text+0x2f7): undefined reference to `File::~File()'
ngram-count.o:ngram-count.cc: (.text+0x31f): undefined reference to `File::File(char const*, char const*, int)'
.
.
.
I checked the include addresses in makefile and all are right.
can anybody help me and give me some tips?
Thanks
Comments
This problem is due to inefficient linking of header file with your code.
you should add "-lm" to your compiling command in terminal at last.
it will fix the problem.