I have to include spellcheck functionality for one of my projects and I decided on hunspell as it's an excellent spellchecker (lots of free and proprietary software's use it). I downloaded the source code and added the project libhunspell to the project. Got it to compile without any errors and also downloaded the english dictionaries form openoffice website. The following is the code I use to initialize hunspell engine and class it's spell check functionality:
Hunspell *spellObj = (Hunspell *)hunspell_initialize("en_us.aff", "en_us.dic");
if(spellObj)
{
int result = hunspell_spell(spellObj, "apply");
hunspell_uninitialize(spellObj);
}
The code doesn't throw any errors but hunspell_spell always returns 0 whatever the word may be.