Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7666377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:49:05+00:00 2026-05-31T14:49:05+00:00

My goal is to create a simple Win32 Console application that uses HunSpell to

  • 0

My goal is to create a simple Win32 Console application that uses HunSpell to spell-check a word the user has entered.
I tried to follow this codeproject tutorial which is for Visual Studio 2008 and HunSpell 1.2.1.

I don’t want to use the provided code, since I intend to write my own.
Furthermore I want to add HunSpell as a dll, not as a static library.

Following are the steps I took:

  1. Created a Win32 console (empty) project with the name myproject.
  2. Downloaded HunSpell 1.3.2 from SourceForge.org.
  3. Copied hunspell-1.3.2\src\hunspell and win_api to myproject\myproject\HunSpell-Src
  4. Added and converted project libhunspell myproject\myproject\HunSpell-Src\win-api\libhunspell.vcproj
    to the solution.
  5. Made my debug build use debug_dll and my release build release_dll of libhunspell in the Configuration Manager.
  6. Rebuilt the libhunspell project, libhunspell.dll is generated in debug_dll and release_dll folders respectively.
  7. Made my console project depend on libhunspell. (Added reference to libhunspell)
  8. Copied dictionary files en_US.aff & en_US.dic to myproject\myproject\HunSpell-Dic after downloading them from SourceForge.org.

I can’t figure out how/where to add the processor define HSPELLEDIT_DLL that is mentioned in the codeproject tutorial.

Following the steps listed under “To use the functionality from the class library in the console application” on MSDN didn’t changed the result.

I want to test it with a program like this:

#include <iostream>
#include "HunSpell-Src/win_api/hunspelldll.h"

using namespace std;

void main()
{
    void *spellObj = hunspell_initialize("HunSpell-Dic\\en_us.aff", "HunSpell-Dic\\en_us.dic");

    char str[60];

    cin >> str;

    int result = hunspell_spell(spellObj, str);

    if(result == 0)
        cout << "Spelling error!";
    else
        cout << "Correct Spelling!";

    hunspell_uninitialize(spellObject);
}

VS produces the following error message if I try to compile it:

myproject\myproject\hunspell-src\win_api\hunspelldll.h(34): fatal error C1083: Cannot open include file: 'hunspell.hxx': No such file or directory

Hunspell.hxx is present in myproject\myproject\HunSpell-Src\hunspell. IntelliSense marks the #include “hunspell.hxx” as an error while the tab hasn’t focus with the message “Error: cannot open source file hunspell.hxx”, but after giving focus to it the error disappears.

Thank you for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T14:49:06+00:00Added an answer on May 31, 2026 at 2:49 pm

    The preprocessor definition, HSPELLEDIT_DLL, is not needed unless you are going to actually use the codeproject author’s custom control. In the case you want to define it (or other preprocessor definitions) refer to /D (Preprocessor Definitions).

    Your path strings need to be double \\ instead of single \ escaped and you have some compile issues:

    #include <iostream>
    #include "HunSpell-Src/win_api/hunspelldll.h"
    
    using namespace std;
    
    void main()
    {
        Hunspell *spellObj = (Hunspell *)hunspell_initialize("HunSpell-Dic\\en_us.aff", "HunSpell-Dic\\en_us.dic");
    //  ^change * type        ^cast returned void* to type that will be used later
    
        char str[60];
    
        cin >> str;
    
        int result = hunspell_spell(spellObj, str);
    
        if(result == 0)
            cout << "Spelling error!";
        else
            cout << "Correct Spelling!";
    
        hunspell_uninitialize(spellObj /*SpellObject is undefined*/);
    //                        ^use correct variable
    }
    

    For Hunspell.hxx, you need to tell your project how to find it. To do this, open your project settings and and the path to Hunspell.hxx to ‘Additional Include Directories’ under Configuration Properties > C++ > General. Refer to /I (Additional Include Directories).

    Based on your directory structure:

    • Your Project > Properties > Configuration Properties > C++ > General > 'Additional Include Directories' should look like: .\HunSpell-Src\hunspell;%(AdditionalIncludeDirectories)

    • Your Project > Properties > Configuration Properties > Linker > General > 'Additional Library Directories' should look like: .\Debug_dll\libhunspell;%(AdditionalLibraryDirectories)

    You will also need to copy myproject\myproject\Debug_dll\libhunspell\libhunspell.dll to your projects output directory (.\Debug) or your exe will not be able to find it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My goal is to create an executable that will start a shadow copied application.
I'm trying to create a simple game in Pascal. It uses the console. The
For an experiment, I'd like to create a simple graphical application. My goal isn't
My goal here is to create a very simple template language. At the moment,
This is proof of concept project - The goal is to create an application
Question for Python 2.6 I would like to create an simple web application which
I want to create a simple class that I can use and encode as
My goal is to create a log app, apart from my main app, that
I'm trying to create a simple function to do a status test. Goal is
I've created an object Chartblock that implements QGraphicsItem. My goal is to create a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.