PDA

View Full Version : Unable to build / compile Hunspell lib for spell checking



donelron
7th October 2020, 19:25
I am trying to implement a spell checker according to this example:
https://wiki.qt.io/Spell-Checking-with-Hunspell

Following the links on this page to the Hunspell library took me here: https://github.com/hunspell/hunspell
where I followed the instructions to compile Hunspell in Cygwin environment on Windows. What makes me wonder is that there is no include directory in the Hunspell master branch. In the SpellChecker.pro file that can be found here https://github.com/hunspell/hunspell there are the following lines:


win32 {
INCLUDEPATH += C:/path/to/hunspell/include
LIBS += C:/path/to/hunspell/Release/hunspell.lib
}

After I'm done with these instructions https://github.com/hunspell/hunspell I have neither an include directory, nor do I have a lib directory.

What am I missing here?

d_stranz
7th October 2020, 22:14
What am I missing here?

Did you also perform the install step? If so, do you know where it installed to? It is likely that the build is out-of-source, so it will not build or install into the source code master branch. The master branch does not have an include directory - all of the .h and .hxx files are in the src directory. Making install likely creates the include directory in the install location and copies the appropriate header files to it, and also creates a lib directory for the binaries and copies them there.

The make command probably has a "verbose" option which will spew out a log of everything it is doing. If you redirect that to a file, you'll be able to go back and figure out where things are.

donelron
8th October 2020, 11:31
Cygwin installed the include directory and the lib directory to an "unexpected" path: C:\cygwin64\usr\local\...
Besides, it did not generate a .lib File, but instead I got:
C:/cygwin64/usr/local/lib/libhunspell-1.7.a
C:/cygwin64/usr/local/lib/libhunspell-1.7.dll.a
C:/cygwin64/usr/local/lib/libhunspell-1.7.la

So, currently the include works, i. e. the files that use an #include "hunspell.hxx" compile, but I get a linker error when building the project. I think I need a .lib file so I need to convince Cygwin to generate me one?!? Or else, I need to use another tool for building the lib-file?!?

d_stranz
8th October 2020, 22:51
AFAIK, linux does not use .lib files. Static libraries are .a, shared libraries are .so. .la are files used by libtools. See this stackoverflow (https://stackoverflow.com/questions/12237282/whats-the-difference-between-so-la-and-a-library-files/12237595) post.