After I managed to get Hunspell working with a Win32 console application, I want to use Hunspell in an MFC application in the same solution. I get the following error when I try to compile the MFC application.
spellcheck\hunspell-src\hunspell\replist.hxx(23): error C2062: type 'const char' unexpected
spellcheck\hunspell-src\hunspell\replist.hxx(23): error C2238: unexpected token(s) preceding ';'
Some information about the solution:
spellcheck\hunspell-src\hunspell
and spellcheck\hunspell-src\win_api
.libhunspell
has been imported and compiles without errors.HunSpell-Src
and HunSpell-Dic
are NOT located in a project folder but in the solution folder spellcheck
and referenced properly.I have setup the MFC application as following:
MFC2
.libhunspell
to MFC2
.Project > Properties > Configuration Properties > C++ > General > Additional Include Directories
has been set to: ..\hunspell-src\hunspell;%(AdditionalIncludeDirectories)
(the same as the console application)Project > Properties > Configuration Properties > Linker > General > Additional Library Directories
has been set to: ..\hunspell-src\win_api\Debug_dll\libhunspell;%(AdditionalLibraryDirectories)
(the same as the console application)#include "../HunSpell-Src/win_api/hunspelldll.h"
under #include MainFrm.h
in Mainfrm.cpp
.I decided to put the #include of hunspelldd.h
in Mainfrm.cpp
and omit setting up a dialog and calling it in order to keep this question as short as possible. Nevertheless I have setup a project as described that produces said error messages.
Because the console application compiles fine, I assume something MFC specific is causing the problem.
Thank you for your help.
Add "#undef near" before class declaration in replist.hxx