I have created a project with intention of using hunspell functions in it. I am working in Ubuntu. I installed and compiled hunspell library and linked it with g++ -o wc.exe -lhunspell-1.6 wordcheck.cxx and everything seemed ok. But when I tried to compile and launch my project I got some errors.
#include <iostream>
#include "hunspell/hunspell.hxx"
using namespace std;
int main(int argc,char** argv)
{
FILE* lst=fopen("wordlist.txt","r");
if(!lst)
{
cerr<<"Can not open file\n";
return 1;
}
Hunspell* hs=new Hunspell(argv[1],argv[2]);
delete hs;
return 0;
}
and the errors were:
/home/alex2/Документы/bO/wordcheck.cxx:14: undefined reference to Hunspell::Hunspell(char const*, char const*, char const*)'
/home/alex2/Документы/bO/wordcheck.cxx:15: undefined reference to
Hunspell::~Hunspell()'
collect2: error: ld returned 1 exit status
atus
I have no idea what is wrong. I tried using
Hunspell* hs=new Hunspell();
and got that there is a candidate for it that requires three parameters:
/usr/local/include/hunspell/hunspell.hxx:115:3: note: candidate: Hunspell::Hunspell(const char*, const char*, const char*) Hunspell(const char* affpath, const char* dpath, const char* key = NULL);
The only difference is char const* and const char* but I always thought it is the same thing. The entire project is similar to the example file hunspell provides and I have no idea what am I doing wrong and why my thing is not working.