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. Add lib
Forum Updated to NodeBB v4.3 + New Features

Add lib

Scheduled Pinned Locked Moved Qt WebKit
8 Posts 2 Posters 3.3k Views 1 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.
  • B Offline
    B Offline
    brcontainer
    wrote on last edited by
    #1

    What folder should I put hunspell (Windows)?

    @LIBS += -lhunspell@

    I tried adding the main folder of the project, tried to add the folder "src", but both cause the following error:

    bq. error: cannot find -lhunspell

    I tried doing this:

    @LIBS += -LC:/Users/cr/Desktop/QT/qtwebkit-plugins-master/src/hunspell@

    but this error occurs:

    bq. C:\Users\cr\Desktop\QT\qtwebkit-plugins-master\src\spellcheck\speller.cpp:57: error: undefined reference to Hunspell::Hunspell(char const*, char const*, char const*)

    see all errors that occur in the following image:
    !http://s7.postimg.org/jvt5emw7v/5ae81318_090d_11e3_8dee_23f730f163bb.png(error lib)!

    QT project: https://github.com/brcontainer/qt-helper

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Possibly that library was compiled using a different compiler than the one you are using.

      (Z(:^

      1 Reply Last reply
      0
      • B Offline
        B Offline
        brcontainer
        wrote on last edited by
        #3

        I'm using mingw 4.8.

        QT project: https://github.com/brcontainer/qt-helper

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          I don't care about that much, but thanks for sharing. Let's try again:
          have hunspell, your application and Qt libraries all been compiled using the same compiler?

          Also, remember to show the compiler the headers using INCLUDEPATH in your .pro file. I guess you have done that already, though, as compiler seems happy.

          (Z(:^

          1 Reply Last reply
          0
          • B Offline
            B Offline
            brcontainer
            wrote on last edited by
            #5

            Thanks, I'm almost there, but still some errors occur, see:

            Code:
            @ HEADERS = $$PWD/hunspell/affentry.hxx
            $$PWD/hunspell/affixmgr.hxx
            $$PWD/hunspell/atypes.hxx
            $$PWD/hunspell/baseaffix.hxx
            $$PWD/hunspell/csutil.hxx
            $$PWD/hunspell/dictmgr.hxx
            $$PWD/hunspell/filemgr.hxx
            $$PWD/hunspell/hashmgr.hxx
            $$PWD/hunspell/htypes.hxx
            $$PWD/hunspell/hunspell.h
            $$PWD/hunspell/hunspell.hxx
            $$PWD/hunspell/hunzip.hxx
            $$PWD/hunspell/langnum.hxx
            $$PWD/hunspell/phonet.hxx
            $$PWD/hunspell/suggestmgr.hxx
            $$PWD/hunspell/w_char.hxx
            $$PWD/qwebkitplatformplugin.h
            $$PWD/spellcheck.h
            $$PWD/speller.h

            SOURCES += $$PWD/hunspell/affentry.cxx \
                    $$PWD/hunspell/affixmgr.cxx \
                    $$PWD/hunspell/csutil.cxx \
                    $$PWD/hunspell/dictmgr.cxx \
                    $$PWD/hunspell/filemgr.cxx \
                    $$PWD/hunspell/hashmgr.cxx \
                    $$PWD/hunspell/hunspell.cxx \
                    $$PWD/hunspell/hunzip.cxx \
                    $$PWD/hunspell/phonet.cxx \
                    $$PWD/hunspell/suggestmgr.cxx \
                    $$PWD/hunspell/utf_info.cxx \
             $$PWD/spellcheck.cpp \
             $$PWD/speller.cpp@
            

            Errors:
            @./....\qtwebkit-plugins-master\build\affixmgr.o: In function ZN8AffixMgrD2Ev': C:\Users\cr\Desktop\DESK\CPP\QT\build-qtwebkit-plugins-Desktop_Qt_5_1_0_MinGW_32bit-Debug\src/../../qtwebkit-plugins-master/src/spellcheck/hunspell/affixmgr.cxx:187: undefined reference to RepList::~RepList()'
            C:\Users\cr\Desktop\DESK\CPP\QT\build-qtwebkit-plugins-Desktop_Qt_5_1_0_MinGW_32bit-Debug\src/../../qtwebkit-plugins-master/src/spellcheck/hunspell/affixmgr.cxx:188: undefined reference to RepList::~RepList()' ./..\..\qtwebkit-plugins-master\build\affixmgr.o: In function ZN8AffixMgr15parse_convtableEPcP7FileMgrPP7RepListPKc':
            Makefile.Debug:102: recipe for target '....\qtwebkit-plugins-master\bin\qtwebkitpluginsd.dll' failed
            C:\Users\cr\Desktop\DESK\CPP\QT\build-qtwebkit-plugins-Desktop_Qt_5_1_0_MinGW_32bit-Debug\src/../../qtwebkit-plugins-master/src/spellcheck/hunspell/affixmgr.cxx:3624: undefined reference to RepList::RepList(int)' C:\Users\cr\Desktop\DESK\CPP\QT\build-qtwebkit-plugins-Desktop_Qt_5_1_0_MinGW_32bit-Debug\src/../../qtwebkit-plugins-master/src/spellcheck/hunspell/affixmgr.cxx:3656: undefined reference to RepList::~RepList()'
            C:\Users\cr\Desktop\DESK\CPP\QT\build-qtwebkit-plugins-Desktop_Qt_5_1_0_MinGW_32bit-Debug\src/../../qtwebkit-plugins-master/src/spellcheck/hunspell/affixmgr.cxx:3681: undefined reference to RepList::add(char*, char*)' ./..\..\qtwebkit-plugins-master\build\hunspell.o: In function ZN8Hunspell5spellEPKcPiPPc':
            C:\Users\cr\Desktop\DESK\CPP\QT\build-qtwebkit-plugins-Desktop_Qt_5_1_0_MinGW_32bit-Debug\src/../../qtwebkit-plugins-master/src/spellcheck/hunspell/hunspell.cxx:346: undefined reference to RepList::conv(char const*, char*)' ./..\..\qtwebkit-plugins-master\build\hunspell.o: In function ZN8Hunspell7suggestEPPPcPKc':
            C:\Users\cr\Desktop\DESK\CPP\QT\build-qtwebkit-plugins-Desktop_Qt_5_1_0_MinGW_32bit-Debug\src/../../qtwebkit-plugins-master/src/spellcheck/hunspell/hunspell.cxx:700: undefined reference to RepList::conv(char const*, char*)' C:\Users\cr\Desktop\DESK\CPP\QT\build-qtwebkit-plugins-Desktop_Qt_5_1_0_MinGW_32bit-Debug\src/../../qtwebkit-plugins-master/src/spellcheck/hunspell/hunspell.cxx:1009: undefined reference to RepList::conv(char const*, char*)'
            ./....\qtwebkit-plugins-master\build\hunspell.o: In function ZN8Hunspell7analyzeEPPPcPKc': C:\Users\cr\Desktop\DESK\CPP\QT\build-qtwebkit-plugins-Desktop_Qt_5_1_0_MinGW_32bit-Debug\src/../../qtwebkit-plugins-master/src/spellcheck/hunspell/hunspell.cxx:1384: undefined reference to RepList::conv(char const*, char*)'
            collect2.exe: error: ld returned 1 exit status
            mingw32-make[2]: *** [....\qtwebkit-plugins-master\bin\qtwebkitpluginsd.dll] Error 1@

            I did download these files:

            QtWekibt-plugins:

            https://github.com/QupZilla/qtwebkit-plugins/

            hunspell:

            http://downloads.sourceforge.net/hunspell/hunspell-1.3.2.tar.gz

            QT project: https://github.com/brcontainer/qt-helper

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              So now you are not linking the library, but compiling it into (inside) your application.

              (Z(:^

              1 Reply Last reply
              0
              • B Offline
                B Offline
                brcontainer
                wrote on last edited by
                #7

                I have to compile the ./configure file (which is in the folder hunspell) before adding to the QT project. Is this the problem?

                QT project: https://github.com/brcontainer/qt-helper

                1 Reply Last reply
                0
                • sierdzioS Offline
                  sierdzioS Offline
                  sierdzio
                  Moderators
                  wrote on last edited by
                  #8

                  So much to explain... ok let's do it from grounds up.

                  There are many ways in which you can include external code/ functionality. One of them is to include a (shared) library. Library is a binary file that - given certain knowledge - can be used by other compiled binaries. It is not possible out of the box - in order to access the library, you need a list of all the exported (that is: available to you) methods and classes. This (I'm simplifying a lot here) is done by including the library headers into your code. When those headers are read by the compiler/ linker, they adjust your code so that it can talk with that binary library after compilation. In Qt/qmake, this is done by adding header directories only to INCLUDEPATH variable:
                  @
                  INCLUDEPATH += /path/to/library/headers
                  @

                  So, you need to compile (or download precompiled) library first, then compile your project while pointing it to those header files. To stress the point: library sources (.cpp) are not present anywhere in this scenario, they are not needed :)

                  Another way is to use static libraries. This is very similar to above in practice, although it differs in theory. I won't get into that, we don't need to know this at this moment.

                  Yet another way, possible but seldom used, is to incorporate all the headers and sources into your project (your last attempt does this) using HEADERS and SOURCES variables in qmake. This does not require you to precompile your library, but is usually much harder to do, can cause licensing problems and in general means more work for little gain. Once compiled, the library is not really a library anymore: it is just another part of your application, fully integrated.

                  Hope this clears things up a bit.

                  (Z(:^

                  1 Reply Last reply
                  0

                  • Login

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