Results 1 to 11 of 11

Thread: Problems using qwt

  1. #1
    Join Date
    May 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Problems using qwt

    Hello. I am trying to make a program showing a simple compass in Qt. I installed qwt 6.0.0 successfully (i think. did make and make install without any errors).

    Now I started a new qt GUI project in qt creator. I added the following lines to the *.pro file:
    INCLUDEPATH += C:\qwt-6.0.0\src
    LIBS += -L"./libs" \
    C:\qwt-6.0.0\lib\libqwt.a \
    C:\qwt-6.0.0\lib\libqwtmathml.a

    I then added #include <qwt_compass.h> to mainwindow.h
    In the mainwindow constructor i added a compass:

    QwtCompass *compass;
    compass = new QwtCompass(this);

    The program compiles fine (i use the release build), but it will not run. If i remove the "new compass"-line it runs just fine. Anyone knows what I did wrong?

    Really appreciate any help!

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

    Default Re: Problems using qwt

    Quote Originally Posted by Guddleif View Post
    I added the following lines to the *.pro file: ...
    Configure qmake so that it is aware of the Qwt feature files ( read the INSTALL file once more ) and then replace all what you have added to your project file by:

    Qt Code:
    1. CONFIG += qwt
    To copy to clipboard, switch view to plain text mode 

    Uwe

  3. #3
    Join Date
    May 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problems using qwt

    Thanks for the fast reply Uwe.

    I copied the qwt.prf into C:\Qt\2010.05\qt\mkspecs\features\win32 and added CONFIG += qwt to my project file.

    Now when I try to compile it does not find the qwt-header-files. How do i configure qmake?

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

    Default Re: Problems using qwt

    What is so difficult about doing what is written in the INSTALL advices ?

    Don't copy files around ( your copying was incomplete ) - instead configure qmake to check the directory, where make install has installed the features files.

    Uwe

  5. #5
    Join Date
    May 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problems using qwt

    Well, i still dont know how to configure qmake.

    The reason i copied the file is that your INSTALL advices redirected me to http://doc.qt.nokia.com/4.7/qmake-ad...ation-features where it said that qmake automatically checks the features\win32-folder.

    If you could tell me how to configure qmake to check the qwt folder, that would be of great help.

    Thanks again for helping me out.

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

    Default Re: Problems using qwt

    Quote Originally Posted by Guddleif View Post
    The reason i copied the file is that your INSTALL advices redirected me to http://doc.qt.nokia.com/4.7/qmake-ad...ation-features where it said that qmake automatically checks the features\win32-folder.
    This page explicitely documents how to configure qmake to look for features files. What else are you asking for ?

    I'm using #2 setting QMAKEFEATURES as a property ( qmake -set QMAKEFEATURES ... ) but this one is not better or worse than the other solutions.

    The problem with copying qwt.prf is, that it includes qwtconfig.pri that you didn't copy. But beside this: don't copy files around as long as you don't know what you are doing + don't mix up Qt and Qwt installations. Even if you believe this is easier - it isn't.

    Uwe

  7. #7
    Join Date
    May 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problems using qwt

    Sorry for acting like an idiot, but I probably just lack some basic knowledge about variables.

    If I want to use #2, like you did, how do I change the QMAKEFEATURES property variable? And where do I find it? From you answer above I guess I have to open a command window, go to a certain directory and then write "qmake -set QMAKEFEATURES ...something". Hope my ignorance doesn't make you too frustrated

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

    Default Re: Problems using qwt

    Quote Originally Posted by Guddleif View Post
    I guess I have to open a command window, ...
    Yes.
    ...go to a certain directory
    No ( when qmake can be found using the PATH environment variable ).
    ...then write "qmake -set QMAKEFEATURES ...something".
    Yes, where "something" is the path, where you have installed the features file.

    On my Linux box it is "/usr/local/qwt-6.0.0/features" on you box it depends on the path you have configured in qwtconfig.pri - maybe: "C:/Qwt-6.0.0/features".

    Uwe

  9. #9
    Join Date
    May 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problems using qwt

    Okay. I added the path to QMAKEFEATURES. When I now type "qmake -query QMAKEFEATURES" the output is : "C:\qwt-6.0.0\features" which is the right directory. So I guess it has been added to the variable correctly.

    I started a new project in Qt and added "CONFIG += qwt" to the .pro-file. I then added "#include <qwt_compass.h>" to mainwindow.h. When I try to compile I still get the error "qwt_compass.h: no such file or directory".

    Any idea?

  10. #10
    Join Date
    May 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problems using qwt

    Little update. If I set "qmake -set QMAKEFEATURES C:\qwt-6.0.0" instead of C:\qwt-6.0.0\features I can compile again without errors. However, as soon as I try to use qwt in my program it crashes. So I'm kinda back to square one...

  11. #11
    Join Date
    May 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problems using qwt

    New update. I think I might have found the cause of the problems. I deleted qwt and unzipped the latest version (6.0.0) again. when I go to the folder and type mingw32-make it starts compiling, but after a while the following error appears:

    .
    .
    .
    compiling qwt_slider.cpp
    compiling qwt_thermo.cpp
    compiling qwt_wheel.cpp
    moc qwt_dyngrid_layout.h
    /usr/bin/sh: C:/Qt/2010.05/qt/bin/moc.exe: Invalid argument
    mingw32-make[2]: *** [moc/moc_qwt_dyngrid_layout.cpp] Error 126
    mingw32-make[2]: Leaving directory `c:/Qt/2010.05/qt/qwt-6.0.0/src'
    mingw32-make[1]: *** [debug-all] Error 2
    mingw32-make[1]: Leaving directory `c:/Qt/2010.05/qt/qwt-6.0.0/src'
    mingw32-make: *** [sub-src-make_default-ordered] Error 2

    Does anyone know what to do?

Similar Threads

  1. Replies: 2
    Last Post: 23rd July 2010, 14:53
  2. Problems with s60
    By emrares in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 8th January 2010, 11:23
  3. Problems using DLL
    By larsli in forum Qt Programming
    Replies: 11
    Last Post: 15th July 2006, 10:18
  4. Problems
    By euthymos in forum Installation and Deployment
    Replies: 2
    Last Post: 13th June 2006, 19:11
  5. QT4 Plugins - problems, problems
    By NormanDunbar in forum Qt Programming
    Replies: 6
    Last Post: 9th May 2006, 15:39

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.