Note that there are some explanatory texts on larger screens.

plurals
  1. POC++ - Using Hunspell with MFC
    text
    copied!<p><a href="https://stackoverflow.com/questions/9703520/c-using-hunspell-1-3-2-with-visual-studio-2010">After I managed to get Hunspell working with a Win32 console application</a>, 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.</p> <pre><code>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 ';' </code></pre> <p>Some information about the solution:</p> <ul> <li>The solution is called spellcheck.</li> <li>The Hunspell source files are located in <code>spellcheck\hunspell-src\hunspell</code> and <code>spellcheck\hunspell-src\win_api</code>.</li> <li>The project <code>libhunspell</code> has been imported and compiles without errors.</li> <li>A console application in the solution uses the same hunspell dll/source files and has <strong>no errors</strong>.</li> <li>The console application has been setup accordingly to <a href="https://stackoverflow.com/questions/9703520/c-using-hunspell-1-3-2-with-visual-studio-2010">this thread</a></li> <li>The folders <code>HunSpell-Src</code> and <code>HunSpell-Dic</code> are NOT located in a project folder but in the solution folder <code>spellcheck</code> and referenced properly.</li> </ul> <p>I have setup the MFC application as following:</p> <ol> <li>Added a new MFC application (SDI) as project to the solution called <code>MFC2</code>.</li> <li>Added a reference to the project <code>libhunspell</code> to <code>MFC2</code>.</li> <li><code>Project &gt; Properties &gt; Configuration Properties &gt; C++ &gt; General &gt; Additional Include Directories</code> has been set to: <code>..\hunspell-src\hunspell;%(AdditionalIncludeDirectories)</code> (the same as the console application)</li> <li><code>Project &gt; Properties &gt; Configuration Properties &gt; Linker &gt; General &gt; Additional Library Directories</code> has been set to: <code>..\hunspell-src\win_api\Debug_dll\libhunspell;%(AdditionalLibraryDirectories)</code> (the same as the console application)</li> <li>Added <code>#include "../HunSpell-Src/win_api/hunspelldll.h"</code>under <code>#include MainFrm.h</code> in <code>Mainfrm.cpp</code>.</li> </ol> <p>I decided to put the #include of <code>hunspelldd.h</code> in <code>Mainfrm.cpp</code> 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.</p> <p>Because the console application compiles fine, I assume something MFC specific is causing the problem.</p> <p>Thank you for your help.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload