Results 1 to 12 of 12

Thread: Problem with building the project with qwt module

  1. #1
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Problem with building the project with qwt module

    First part:
    ''''''''''''''''''
    I've installed qwt-6.0.1 in C:\qwt-6.0.1\ by following steps:
    qmake qwt.pro
    mingw32-make
    mingw32-make install

    Then I tried this for running examples:
    cd examples
    qmake examples.pro
    mingw32-make

    So with this I'm successfully able open examples in Qt creator, build & run given in the C:\qwt-6.0.1\examples directory.

    Second Part:
    '''''''''''''''''''''''''

    I've created a project in D:\My_App\ directory. I want to use qwt library to draw required graphs. In examples I find some files with .pri extension, but I don't have any in my project folder. Then I edited my My_App.pro file to configure the paths:

    # Project created by QtCreator 2012-04-18T09:43:46
    #
    #-------------------------------------------------

    QT += core gui

    INCLUDEPATH += C:\qwt-6.0.1\include

    LIBS += -L"C:\qwt-6.0.1\lib" \
    -lqwtd \
    -lqwt

    TARGET = My_Application
    TEMPLATE = app


    SOURCES += main.cpp\
    mainwindow.cpp \
    paramdisplaywindow.cpp \
    paramwidget.cpp \
    devicestate.cpp \
    loginscreen.cpp \
    graphdialog.cpp

    HEADERS += mainwindow.h \
    paramdisplaywindow.h \
    paramwidget.h \
    devicestate.h \
    loginscreen.h \
    graphdialog.h
    #-------------------------------------------------------------------------

    If I build the project in Qt creator, the following warning message is appearing:
    "warning: auto-importing has been activated without --enable-auto-import specified on the command line."
    Then if I run the project, the following message: "The program has unexpectedly finished."

    Is that all I need to add in .pro file. Where am I doing the mistake ? Please help me with this. Thank you.

  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: Problem with building the project with qwt module

    Read the INSTALL file about how to use "CONFIG += qwt".

    Uwe

  3. #3
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Problem with building the project with qwt module

    Quote Originally Posted by Uwe View Post
    Read the INSTALL file about how to use "CONFIG += qwt".

    Uwe
    Before doing that I didn't understand the other line in the INSTALL instructions, please help me understand the following lines.

    Windows doesn't like mixing of debug and release binaries. Most
    of the problems with using the Qwt designer plugin are because
    of trying to load a Qwt debug library into a designer release
    executable.

    Don't forget to tell qmake where to find qwt.prf:
    qmake -set QMAKEFEATURES ...
    I use Qt creator to build & run the project. Does this mean that this following lline applies to me?
    For building a Qwt application with qmake use the Qwt configuration features
    file, that has been installed by "make install". When qmake is able to find
    it ( http://doc.qt.nokia.com/4.7/qmake-ad...ation-features )
    Thank you.
    Last edited by rawfool; 24th April 2012 at 06:23.

  4. #4
    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: Problem with building the project with qwt module

    Quote Originally Posted by rawfool View Post
    I use Qt creator to build & run the project. Does this mean that this following line applies to me?
    Sure the creator uses qmake.

    Uwe

  5. #5
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Problem with building the project with qwt module

    Uwe, I read the INSTALL manual and also read other threads where you have explained this process to fellow people.
    OK,
    Now I did this using command line terminal Qt 4.7.4 for Desktop (MinGW).

    qmake -set QMAKEFEATURES "C:\qwt-6.0.1\features"
    Though I used mingw32-make during installation, in the above step to set QMAKEFEATURES, I used just qmake (this I followed by looking at the other threads).

    Then I've added CONFIG += qwt in my My_App.pro file. I'm getting errors like error: qwt_plot.h: No such file or directory. I think I've to mention include path, but I don't know where. Please help me further.

    Note: My .pro file is in D:\My_App\ directory, but my qwt installation is in C:\qwt-6.0.1\ directory. Does this make any difference?

    My .pro file looks like this. Is it correct ? Where's the problem?
    #-------------------------------------------------
    #
    # Project created by QtCreator 2012-04-18T09:43:46
    #
    #-------------------------------------------------

    QT += core gui

    CONFIG += qwt

    TARGET = My_Application
    TEMPLATE = app


    SOURCES += main.cpp\
    mainwindow.cpp \
    paramdisplaywindow.cpp \
    paramwidget.cpp \
    devicestate.cpp \
    loginscreen.cpp \
    graphdialog.cpp

    HEADERS += mainwindow.h \
    paramdisplaywindow.h \
    paramwidget.h \
    devicestate.h \
    loginscreen.h \
    graphdialog.h

  6. #6
    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: Problem with building the project with qwt module

    Check the window, where you find the compiler commands. Here you should see the include paths, that are used for compiling your code ( maybe add "CONFIG -= silent", when the output is suppressed ). I would guess, that the Qwt install directory is not there.

    If true it means, that your QMAKEFEATURES is not set properly - or set for a different qmake environment, that the one that is used by the creator.

    Uwe

  7. #7
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Problem with building the project with qwt module

    my output is

    D:\AIMS_App\AIMS_Application>qmake -project

    D:\AIMS_App\AIMS_Application>qmake

    D:\AIMS_App\AIMS_Application>mingw32-make
    mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory `D:/AIMS_App/AIMS_Application'
    g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
    DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -
    DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\QtSDK\
    Desktop\Qt\4.7.4\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\includ
    e\QtGui" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include" -I"." -I"c:\QtSDK\Desktop\Q
    t\4.7.4\mingw\include\ActiveQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\mks
    pecs\default" -o debug\graphdialog.o graphdialog.cpp
    In file included from graphdialog.cpp:1:
    graphdialog.h:6:22: error: qwt_plot.h: No such file or directory
    graphdialog.h:7:29: error: qwt_plot_layout.h: No such file or directory
    graphdialog.h:8:24: error: qwt_legend.h: No such file or directory
    graphdialog.h:9:29: error: qwt_legend_item.h: No such file or directory
    graphdialog.h:10:32: error: qwt_plot_histogram.h: No such file or directory
    graphdialog.h:11:27: error: qwt_plot_grid.h: No such file or directory
    In file included from graphdialog.cpp:1:
    graphdialog.h:14: error: expected class-name before '{' token
    graphdialog.cpp: In constructor 'GraphDialog::GraphDialog(QDialog*)':
    graphdialog.cpp:4: error: class 'GraphDialog' does not have any field named 'Qwt
    Plot'
    mingw32-make[1]: *** [debug/graphdialog.o] Error 1
    mingw32-make[1]: Leaving directory `D:/AIMS_App/AIMS_Application'
    mingw32-make: *** [debug] Error 2
    Now after I do this, my .pro file is also changed. I cannot find the line CONFIG += qwt which I added before doing the above process.
    Now my .pro file looks like
    ################################################## ####################
    # Automatically generated by qmake (2.01a) Tue Apr 24 12:49:50 2012
    ################################################## ####################

    TEMPLATE = app
    TARGET =
    DEPENDPATH += .
    INCLUDEPATH += .

    # Input
    HEADERS += devicestate.h \
    graphdialog.h \
    loginscreen.h \
    mainwindow.h \
    paramdisplaywindow.h \
    paramwidget.h
    SOURCES += devicestate.cpp \
    graphdialog.cpp \
    loginscreen.cpp \
    main.cpp \
    mainwindow.cpp \
    paramdisplaywindow.cpp \
    paramwidget.cpp
    Any suggestions Uwe, please..
    Last edited by rawfool; 24th April 2012 at 09:43.

  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: Problem with building the project with qwt module

    Without "CONFIG += qwt" there are no include paths.

    I suggest you should spend some time on learning how to use the creator - for questions better ask on creator related support channels.

    Uwe

  9. #9
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Problem with building the project with qwt module

    Oh Uwe, I got it working. Finally !!
    Thank you very much for all the suggestions and for creating the library itself.

    I've created a custom class in my project like this
    #ifndef GRAPHDIALOG_H
    #define GRAPHDIALOG_H

    #include <qwt.h>
    #include <qwt_plot.h>

    class GraphDialog : public QwtPlot
    {
    Q_OBJECT
    public:
    explicit GraphDialog(QWidget *parent = 0);

    signals:

    public slots:

    };

    #endif // GRAPHDIALOG_H
    Though I didn't start using the library functions itself, now, I'm able to build the project. But I have a small hiccup.
    It's displaying two warning messages which I'm not able to figure out.
    D:\AIMS_App\AIMS_Application\graphdialog.h:5: from graphdialog.h:5,
    c:\Qwt-6.0.1\include\qwt_interval.h:270: warning: 'bool QwtInterval::isValid() const' redeclared without dllimport attribute after being referenced with dll linkage
    c:\Qwt-6.0.1\include\qwt_plot.h:17: In file included from c:\Qwt-6.0.1\include/qwt_plot.h:17,
    c:\Qwt-6.0.1\include\qwt_interval.h:270: warning: 'bool QwtInterval::isValid() const' redeclared without dllimport attribute after being referenced with dll linkage
    What are those warnings?
    Thank you very much.

  10. #10
    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: Problem with building the project with qwt module

    Quote Originally Posted by rawfool View Post
    What are those warnings?
    These warning are because of two inlined methods, that are declared in the wrong order in qwt_interval.h.
    You can ignore them or use Qwt from the SVN 6.0 branch, where it has been fixed.

    Uwe

  11. The following user says thank you to Uwe for this useful post:

    rawfool (24th April 2012)

  12. #11
    Join Date
    Feb 2012
    Posts
    9
    Thanks
    3

    Default Re: Problem with building the project with qwt module

    BTW, which model is the best exmaple to start learning Qwt?
    Thanks.

  13. #12
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Problem with building the project with qwt module

    That depends on your requirements dude. If u want specific type, then look at the corresponding examples for getting started. Either way you choose an example to start, then go further with your own learning from the manual.

Similar Threads

  1. Building a QT project with WAF
    By learningqt in forum Newbie
    Replies: 3
    Last Post: 16th March 2012, 08:15
  2. Project Building
    By .:saeed:. in forum Newbie
    Replies: 0
    Last Post: 3rd February 2011, 10:04
  3. Building a single module
    By inktomi in forum Installation and Deployment
    Replies: 1
    Last Post: 20th August 2009, 17:17
  4. Replies: 0
    Last Post: 26th April 2009, 18:55
  5. Building the entire project
    By vermarajeev in forum Qt Programming
    Replies: 14
    Last Post: 28th February 2007, 04:00

Tags for this Thread

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.