Results 1 to 13 of 13

Thread: How to use QWT in QT4 Creator on Windows?

  1. #1
    Join Date
    Dec 2009
    Location
    Citrus Heights
    Posts
    10
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default How to use QWT in QT4 Creator on Windows?

    Hi everyone,

    I've got QT Creator v4 and Qwt v4.2. How do I put two together? I read the INSTALL file and it seems to be for MS Visual Studio.

    Thanks for the help.

    Kevin

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to use QWT in QT4 Creator on Windows?

    Qwt 4.2 is a pretty old release for Qt 3 and Qt2. It won't work with Qt 4.

    Uwe

  3. #3
    Join Date
    Dec 2009
    Location
    Citrus Heights
    Posts
    10
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to use QWT in QT4 Creator on Windows?

    Great Thanks.

    I have downloaded and build the Qwt 5.2 with my QT Designer. How do I integrate those two?

    Kevin

  4. #4
    Join Date
    Dec 2009
    Location
    Citrus Heights
    Posts
    10
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Question Re: How to use QWT in QT4 Creator on Windows?

    I think I'm getting hand of it. I built Qwt as static and load static plugin using steps from http://qt.nokia.com/doc/4.5/tools-plugandpaint.html (at end of the page). I am now running into a issue.

    When building my application, I get this error:
    release/main.o:main.cpp.text+0x139): undefined reference to `qt_plugin_instance_qwt()'
    collect2: ld returned 1 exit status

    All I did was using Q_IMPORT_PLUGIN(qwt) in main function and modified the .pro file. How should I resolve this issue?

    Kevin

  5. #5
    Join Date
    Dec 2009
    Location
    Citrus Heights
    Posts
    10
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Smile Re: How to use QWT in QT4 Creator on Windows?

    NVM. Got it resolved!!!

  6. #6
    Join Date
    Nov 2009
    Posts
    5
    Qt products
    Qt4

    Default Re: How to use QWT in QT4 Creator on Windows?

    It would be great if you can share how you resolved it.

    Thanks

  7. #7
    Join Date
    Dec 2009
    Location
    Citrus Heights
    Posts
    10
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Talking Re: How to use QWT in QT4 Creator on Windows?

    This is how I setup:
    1. I unzip everything to C:\Qt\2009.04\qwt-5.2.0 folder (C:\Qt\2009.04 is my QT Creator install folder).
    2. I open C:\Qt\2009.04\qwt-5.2.0\qwtconfig.pri file with text editor
    3. enabled debug and release build (around line 50 to line 53)
    4. build static libraries instead of shared (around line 77 to line 79)
    5. save and close the file.
    6. open the C:\Qt\2009.04\qwt-5.2.0\qwt.pro file w/ QT and rebuild the whole thing
    7. open my own project file (<project_name>.pro)
    8. add the following lines to the end of the pro file:
    Qt Code:
    1. QWT_LOCATION = C:/Qt/2009.04/qwt-5.2.0 # Qwt location (must match exactly to where you unzip the files)
    2. INCLUDEPATH += $${QWT_LOCATION}/src
    3. LIBS = -L$${QWT_LOCATION}/lib \
    4. -lqwt
    5.  
    6. # The following section is to select static lib base on debug or release build
    7. if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
    8. mac:LIBS = $$member(LIBS, 0) \
    9. $$member(LIBS, 1)_debug
    10. win32:LIBS = $$member(LIBS, 0) \
    11. $$member(LIBS, 1)d
    12. }
    To copy to clipboard, switch view to plain text mode 
    9. to link to the qwt, use #include <lib_file>. (for example, u need #include <qwt_plot.h> for your code to be able to allocate QwtPlot object.
    10. build your application.

    Kevin

  8. #8
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to use QWT in QT4 Creator on Windows?

    One step is missing: "make install"

    Don't know why, but many people ( especially Windows developers) don't like to install/uninstall Qwt and work with the build directory instead. But at least on unixoid systems ( like the Mac ) you should do it.

    Uwe

  9. #9
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How to use QWT in QT4 Creator on Windows?

    Quote Originally Posted by Uwe View Post
    One step is missing: "make install"

    Don't know why, but many people ( especially Windows developers) don't like to install/uninstall Qwt and work with the build directory instead. But at least on unixoid systems ( like the Mac ) you should do it.

    Uwe
    I think we Windows developers have been burned so many times by Windows DLL compatibility issues that if we get something that works, we don't ever want to rebuild it because that could be a direct path into Hell.

  10. #10
    Join Date
    Jan 2010
    Posts
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to use QWT in QT4 Creator on Windows?

    This works well to me, but do you know if this config works also if after finished my application I only copy the static library and src folder to my application folder and change the QWT_LOCATION to the APP_LOCATION ?

    Quote Originally Posted by Kevin Ching View Post
    This is how I setup:
    1. I unzip everything to C:\Qt\2009.04\qwt-5.2.0 folder (C:\Qt\2009.04 is my QT Creator install folder).
    2. I open C:\Qt\2009.04\qwt-5.2.0\qwtconfig.pri file with text editor
    3. enabled debug and release build (around line 50 to line 53)
    4. build static libraries instead of shared (around line 77 to line 79)
    5. save and close the file.
    6. open the C:\Qt\2009.04\qwt-5.2.0\qwt.pro file w/ QT and rebuild the whole thing
    7. open my own project file (<project_name>.pro)
    8. add the following lines to the end of the pro file:
    Qt Code:
    1. QWT_LOCATION = C:/Qt/2009.04/qwt-5.2.0 # Qwt location (must match exactly to where you unzip the files)
    2. INCLUDEPATH += $${QWT_LOCATION}/src
    3. LIBS = -L$${QWT_LOCATION}/lib \
    4. -lqwt
    5.  
    6. # The following section is to select static lib base on debug or release build
    7. if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
    8. mac:LIBS = $$member(LIBS, 0) \
    9. $$member(LIBS, 1)_debug
    10. win32:LIBS = $$member(LIBS, 0) \
    11. $$member(LIBS, 1)d
    12. }
    To copy to clipboard, switch view to plain text mode 
    9. to link to the qwt, use #include <lib_file>. (for example, u need #include <qwt_plot.h> for your code to be able to allocate QwtPlot object.
    10. build your application.

    Kevin

  11. #11
    Join Date
    Jun 2010
    Posts
    19
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to use QWT in QT4 Creator on Windows?

    Hi!

    I configured Qwt on Windows 7 like you did and all the exemples work !!
    Except, when I try to run a project, I get theses errors related to the qmake step:

    Qt Code:
    1. Exécution des étapes de compilation pour le projet plotscroll...
    2. Configuration non modifiée, passe l'étape QMake.
    3. Lancement : C:/Qt/2010.03/mingw/bin/mingw32-make.exe -w
    4. mingw32-make: Entering directory `C:/Users/Geneviève/Desktop/plotscroll'
    5. c:\qt\2010.03\qt\bin\qmake.exe -spec ..\..\..\..\Qt\2010.03\qt\mkspecs\win32-g++ -win32 -o Makefile plotscroll.pro
    6. mingw32-make: Leaving directory `C:/Users/Geneviève/Desktop/plotscroll'
    7. mingw32-make: Entering directory `C:/Users/Geneviève/Desktop/plotscroll'
    8. C:/Qt/2010.03/mingw/bin/mingw32-make -f Makefile.Debug
    9. mingw32-make[1]: Entering directory `C:/Users/Geneviève/Desktop/plotscroll'
    10. g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\plotscroll.exe debug/plot.o debug/thread.o debug/win.o debug/main.o debug/moc_plot.o debug/moc_thread.o debug/moc_win.o -L"c:\Qt\2010.03\qt\lib" -lmingw32 -lqtmaind -LC:/Qt/2010.03/qwt-5.2.1/qwt-5.2.1/lib\-lqwt d -lQtGuid4 -lQtCored4
    11. mingw32-make[1]: Leaving directory `C:/Users/Geneviève/Desktop/plotscroll'
    12. mingw32-make: Leaving directory `C:/Users/Geneviève/Desktop/plotscroll'
    13. g++: d: No such file or directory
    14. mingw32-make[1]: *** [debug\plotscroll.exe] Error 1
    15. mingw32-make: *** [debug] Error 2
    16. Terminé avec le code de sortie 2.
    17. Erreur lors de la compilation du projet plotscroll //Error in the compilation of plotscroll project
    18. lors de l'éxecution de l'étape 'Make'
    To copy to clipboard, switch view to plain text mode 

    Here's my .pro file:

    Qt Code:
    1. QWT_LOCATION = C:/Qt/2010.03/qwt-5.2.1/qwt-5.2.1 # Qwt location (must match exactly to where you unzip the files)
    2. INCLUDEPATH += $${QWT_LOCATION}/src
    3. LIBS = -L$${QWT_LOCATION}/lib\-lqwt
    4.  
    5. # The following section is to select static lib base on debug or release build7.
    6. if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
    7. mac:LIBS = $$member(LIBS, 0) \
    8. $$member(LIBS, 1)_debug
    9. win32:LIBS = $$member(LIBS,0)\
    10. $$member(LIBS, 1)d
    11. }
    12.  
    13. TEMPLATE = app
    14.  
    15. HEADERS += \
    16. plot.h \
    17. thread.h \
    18. win.h \
    19.  
    20. SOURCES += \
    21. plot.cpp \
    22. thread.cpp \
    23. win.cpp \
    24. main.cpp
    To copy to clipboard, switch view to plain text mode 

    How can I fix this ?
    Thanks for your help !!
    Last edited by gen_mass; 15th June 2010 at 10:14.

  12. #12

    Default Re: How to use QWT in QT4 Creator on Windows?

    Same with me. It's the debug setting that's bugging. Changed it to Release and it seems to work fine.

  13. #13
    Join Date
    May 2011
    Posts
    21
    Thanks
    1
    Thanked 5 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to use QWT in QT4 Creator on Windows?

    15th June 2010...

Similar Threads

  1. using Qwt with windows
    By mesman00 in forum Qwt
    Replies: 6
    Last Post: 20th June 2009, 01:45
  2. QWT & Qt-4.5 Windows CE
    By DirectCPP in forum Qwt
    Replies: 0
    Last Post: 16th June 2009, 19:39
  3. Can qwt work on Windows 7 x64?
    By RavenS in forum Qwt
    Replies: 0
    Last Post: 28th March 2009, 10:37
  4. Replies: 0
    Last Post: 2nd February 2009, 15:24
  5. Problem install qwt on windows
    By kid17 in forum Qwt
    Replies: 5
    Last Post: 3rd December 2008, 13:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.