Results 1 to 7 of 7

Thread: Undefined Reference QwtPlot::QwtPlot(QWidget*)

  1. #1
    Join Date
    Apr 2009
    Posts
    11
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Undefined Reference QwtPlot::QwtPlot(QWidget*)

    Hi,

    I am using Ubuntu 9.04 with the qt4, qt creator and installed qwt using the synaptic manager. Looked like everything worked fine for me. The Designer has the new plugins.

    Started a new project and added a plot widget to a dialog, but when I am trying to compile it fails because it cannot include #include "qwt_plot.h"

    I know how to add new include paths in visual studio but I have no idea how to do that in QTCreator or does somethin different went wrong ?

    Thanks in advance for your help

    kind regards


    loco

    EDIT:
    Ok this is what I did:

    copying the *.h files in src/ to /usr/local/include/:
    Qt Code:
    1. # cp src/*.h /usr/local/include
    To copy to clipboard, switch view to plain text mode 
    copying those in lib/ to /usr/local/lib/.
    Qt Code:
    1. cd lib && tar -cf l.tar *
    2. #
    3. # mv l.tar /usr/local/lib
    4. # cd /usr/local/lib
    5. # tar xf l.tar
    6. # rm l.tar
    To copy to clipboard, switch view to plain text mode 

    running ldconfig:
    Qt Code:
    1. #ldconfig
    To copy to clipboard, switch view to plain text mode 

    No more include error but another one appears:
    Qt Code:
    1. "undefined reference QwtPlot::QwtPlot(QWidget*)"
    To copy to clipboard, switch view to plain text mode 

    Any suggestions ? Sounds like the libs are missing
    Last edited by 27Loco; 24th April 2009 at 13:08.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Undefined Reference QwtPlot::QwtPlot(QWidget*)

    Take a look at the examples shipped with Qwt (specifically their .pro files). You need to link to the Qwt library.
    J-P Nurmi

  3. #3
    Join Date
    Apr 2009
    Posts
    11
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Undefined Reference QwtPlot::QwtPlot(QWidget*)

    Can't compile samples with the QT Creator. I am getting a lot of

    Qt Code:
    1. undefined reference: QwtScaleMap::QwtScaleMap()
    To copy to clipboard, switch view to plain text mode 

    Somethin' gone wrong. Any great installations guides ? Found nothin' helpful for now.

    Thanks

  4. #4
    Join Date
    Apr 2009
    Posts
    11
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up [SOLVED] Undefined Reference QwtPlot::QwtPlot(QWidget*)

    Ok finally i managed to install Qwt on Ubuntu 9.04 and run the examples. It is really simple once you figured out how to install the whole thing. I will post it my step by step guide


    1. Go to http://sourceforge.net/projects/qwt and download the tar.gz file
    2. Extract the package into your home folder \home\YOU\Qwt-5.2.0
    3. Open the Terminal and change into the Qwt directory

    Qt Code:
    1. cd 'home\YOU\Qwt-5.2.0'
    To copy to clipboard, switch view to plain text mode 

    Then

    Qt Code:
    1. qmake
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. sudo make
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. sudo make install
    To copy to clipboard, switch view to plain text mode 

    Okay. Now we have to link the shared libraries. Go to the following folder
    \etc\ld.so.conf.d and open the file libc.conf

    Something like
    Qt Code:
    1. # libc default configuration
    2. /usr/local/lib
    To copy to clipboard, switch view to plain text mode 
    should be in there. Add the line
    Qt Code:
    1. /usr/local/qwt-5.2.0/lib
    To copy to clipboard, switch view to plain text mode 
    Save and close the file. Now lets go back to the terminal.
    Simply enter

    Qt Code:
    1. sudo ldconfig
    To copy to clipboard, switch view to plain text mode 

    To test everything change the path of the terminal to the examples path of qwt and run qmake and make again

    Qt Code:
    1. cd \home\YOU\Qwt-5.2.0\examples
    2. qmake
    3. sudo make
    To copy to clipboard, switch view to plain text mode 

    now open the examples.pro file with the qcreator and everything should work fine.
    Last edited by 27Loco; 26th April 2009 at 17:52. Reason: Title Change

  5. The following user says thank you to 27Loco for this useful post:

    PaceyIV (14th May 2009)

  6. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Undefined Reference QwtPlot::QwtPlot(QWidget*)

    There's no need to compile with super user privileges.
    J-P Nurmi

  7. #6
    Join Date
    Apr 2009
    Posts
    11
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Undefined Reference QwtPlot::QwtPlot(QWidget*)

    I had to because the folder the files were created to was locked for the normal user ^^. But yes you are right

  8. #7
    Join Date
    Mar 2009
    Posts
    98
    Thanks
    3
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [SOLVED] Undefined Reference QwtPlot::QwtPlot(QWidget*)

    Great! Thanks!

    I change only one step of your tutorial.

    Instead of add the line /usr/local/qwt-5.2.0/lib in the libc.conf I create the new file qwt.conf in the same directory.

    Just a question: what lines you need to use in the project.pro file?

    I need to add this:

    INCLUDEPATH += /usr/local/qwt-5.2.0-svn/include/
    LIBS += /usr/local/qwt-5.2.0-svn/lib/libqwt.so.5

    I also try to use CONFIG += Qwt but don't work.

Similar Threads

  1. Compile 4.4.0
    By LordQt in forum Installation and Deployment
    Replies: 18
    Last Post: 29th May 2008, 14:43
  2. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 13:57
  3. Error compiling psql plugin
    By vieraci in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2007, 03:49
  4. qt 4.2.2 install on aix
    By try to remember in forum Installation and Deployment
    Replies: 2
    Last Post: 28th March 2007, 13:19
  5. Qt-x11-commercial-src-4.2.0-snapshot-20060824 error
    By DevObject in forum Installation and Deployment
    Replies: 4
    Last Post: 25th August 2006, 00:31

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.