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:
- The solution is called spellcheck.
- The Hunspell source files are located in
spellcheck\hunspell-src\hunspellandspellcheck\hunspell-src\win_api. - The project
libhunspellhas been imported and compiles without errors. - A console application in the solution uses the same hunspell dll/source files and has no errors.
- The console application has been setup accordingly to this thread
- The folders
HunSpell-SrcandHunSpell-Dicare NOT located in a project folder but in the solution folderspellcheckand referenced properly.
I have setup the MFC application as following:
- Added a new MFC application (SDI) as project to the solution called
MFC2. - Added a reference to the project
libhunspelltoMFC2. Project > Properties > Configuration Properties > C++ > General > Additional Include Directorieshas been set to:..\hunspell-src\hunspell;%(AdditionalIncludeDirectories)(the same as the console application)Project > Properties > Configuration Properties > Linker > General > Additional Library Directorieshas been set to:..\hunspell-src\win_api\Debug_dll\libhunspell;%(AdditionalLibraryDirectories)(the same as the console application)- Added
#include "../HunSpell-Src/win_api/hunspelldll.h"under#include MainFrm.hinMainfrm.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.