Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

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

    General and Desktop
    2
    9
    7064
    Loading More Posts
    • 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
      vezprog last edited by

      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 Reply Quote 0
      • V
        VanDerSam last edited by

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

        1 Reply Last reply Reply Quote 0
        • V
          vezprog last edited by

          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 Reply Quote 0
          • V
            VanDerSam last edited by

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

            1 Reply Last reply Reply Quote 0
            • V
              vezprog last edited by

              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 Reply Quote 0
              • V
                VanDerSam last edited by

                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 Reply Quote 0
                • V
                  vezprog last edited by

                  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 Reply Quote 0
                  • V
                    VanDerSam last edited by

                    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 Reply Quote 0
                    • V
                      vezprog last edited by

                      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 Reply Quote 0
                      • First post
                        Last post