Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Qwt Build (static) success. Now a linking problem.
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved General and Desktop
9 Posts 2 Posters 7.7k Views
  • 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.
  • V Offline
    V Offline
    vezprog
    wrote on last edited by
    #1

    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...

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VanDerSam
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vezprog
        wrote on last edited by
        #3

        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...

        1 Reply Last reply
        0
        • V Offline
          V Offline
          VanDerSam
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • V Offline
            V Offline
            vezprog
            wrote on last edited by
            #5

            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
            }
            @

            1 Reply Last reply
            0
            • V Offline
              V Offline
              VanDerSam
              wrote on last edited by
              #6

              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?

              1 Reply Last reply
              0
              • V Offline
                V Offline
                vezprog
                wrote on last edited by
                #7

                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?

                1 Reply Last reply
                0
                • V Offline
                  V Offline
                  VanDerSam
                  wrote on last edited by
                  #8

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

                  1 Reply Last reply
                  0
                  • V Offline
                    V Offline
                    vezprog
                    wrote on last edited by
                    #9

                    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.

                    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