[Solved] Qwt Build (static) success. Now a linking problem.



  • I have built the Qwt libraries statically successfully and I have the static libraries in a sub folder lib in my build folder (and in my project folder). there is 4 files in the lib folder, qwt.lib (3700kb), qwtd.lib (9200kb), qwtmathml.lib (1200kb), and qwtmathmld.lib (966kb)

    I am unable to add a QwtPlot to my project even with the libraries linked... heres my .pro include

    @

    qwt plot library

    win32 { # windows
    CONFIG(debug, debug|release) {
    LIBS += -Llib\qwtd
    }
    else {
    LIBS += -Llib\qwt
    }
    }
    unix { # linux
    LIBS += -L/usr/local/lib -lqwt-qt4
    LIBS += -L/usr/local/lib -lQtSvg
    }
    @

    I try to include a QwtPlot in my project and it does not recognize the object...

    Any help on this matter? I feel like there is something simple wrong and its on the tip of my nose...



  • You must add qwt include directory to INCLUDEPATH. For example,
    @INCLUDEPATH += /usr/include/qwt/@



  • Are we talking about an includepath to the library folder? or to the Qwt source code folder?

    I am a bit confused since I thought the purpose of the static libraries was to allow for no Qwt source code...



  • The Qwt source code folder has include folder. Please use it.



  • I am doing this in windows, not linux. When i downloaded qwt, my qwt-6.0.1 download folder has a folder structure of:

    designer/
    doc/
    examples/
    lib/
    src/
    textengines/

    the src folder does not have an "include" folder.

    when I built the library statically, it added files to the lib folder in the download folder containing the static.lib files. I have moved the source code to C:/Qt/Qwt/src folder.

    I have tried to make an include path in my .pro file linking to the that folder and am getting a ton of linking errors, which leads me to think that its not picking up the libraries correctly.

    Heres my new .pro (one line code change)
    @

    library include path

    INCLUDEPATH += lib
    INCLUDEPATH += C:/Qt/Qwt/src

    qwt plot library

    win32 { # windows
    CONFIG(debug, debug|release) {
    LIBS += -Llib\qwtd
    }
    else {
    LIBS += -Llib\qwt
    }
    }
    unix { # linux
    LIBS += -L/usr/local/lib -lqwt-qt4
    LIBS += -L/usr/local/lib -lQtSvg
    }
    @



  • LIBS += -Llib\qwtd is not correct. You must specify the full path to the libraries. For example, -LC:/Qt/Qwt/lib/qwtd.
    Are you using MSVC complier?



  • I am using the MSVC 2008 compiler.

    So if this works, this brings me to my next question. When I go to deploy this on another computer that does not have Qwt in that folder, how does the application know where to link the .lib?



  • You are using static linking Qwt library. So your executable file contains the library itself. It doesn't need external Qwt library.



  • I apologize for the confusion, what I am trying to do is make is so I have the libraries my application folder and my application calls into the libraries instead of having them built into my executable. Which I though I was doing by including the library path.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.