Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. problems with adding hunspell library to the project
Forum Updated to NodeBB v4.3 + New Features

problems with adding hunspell library to the project

Scheduled Pinned Locked Moved Unsolved Qt WebKit
3 Posts 3 Posters 1.5k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    UndefBehav
    wrote on 13 May 2017, 10:59 last edited by
    #1

    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?

    K 1 Reply Last reply 13 May 2017, 11:48
    0
    • U UndefBehav
      13 May 2017, 10:59

      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?

      K Offline
      K Offline
      Konstantin Tokarev
      wrote on 13 May 2017, 11:48 last edited by
      #2

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

      M 1 Reply Last reply 13 May 2017, 11:50
      1
      • K Konstantin Tokarev
        13 May 2017, 11:48

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

        M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 13 May 2017, 11:50 last edited by
        #3

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

        1 Reply Last reply
        2

        1/3

        13 May 2017, 10:59

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved