Please nominate your Qt Champions for 2021!

problems with adding hunspell library to the project

  • Hello!
    I have created Qt Project with intention of adding hunspell functions to it. I installed hunspell, compiled it and linked it with right click - add library, and everything seemed ok - when I wrote Hunspell* hs it stood out as a known object and hs-> got me all extsting functions. But when I tried to compile and launch the project I got some errors:

    #include <iostream>
    #include <hunspell\hunspell.hxx>
    using namespace std;
    int main()
        const char* affp="C:\\Dictionaries\\tx_spell_dictionary.ru_RU\\Dictionaries\\ru_RU.aff";
        const char* dicp="C:\\Dictionaries\\tx_spell_dictionary.ru_RU\\Dictionaries\\ru_RU.dic";
        Hunspell* hs=new Hunspell(affp,dicp);
        cout << "Hello World!" << endl;
        return 0;

    and the errors were:

    C:\QTProjects\11\untitled\main.cpp:9: ошибка: undefined reference to `Hunspell::Hunspell(char const*, char const*, char const*)'
    collect2.exe:-1: ошибка: error: ld returned 1 exit status

    I installed hunspell and compiled it for Windows using MSYS2 with MinGW and Qt uses MinGW as well. The only difference is that I compiled the library with 64bit MinGW and Qt only has 32. Is this the problem? Or there is something else?

  • @UndefBehav Your project doesn't link the library where Hunspell::Hunspell(char const*, char const*, char const*) is defined

  • Lifetime Qt Champion

    As far as i know linking 64 bit dll to 32 bit app is a no go.

Log in to reply