Results 1 to 11 of 11

Thread: undefined reference to `QwtPlot::qt_metacall(QMetaObject::Call, int, void**)'

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2009
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default undefined reference to `QwtPlot::qt_metacall(QMetaObject::Call, int, void**)'

    I'm struggling to get a QWT plot into my application with so little documentation -- an official intro/howto guide would be helpful. The few examples lingering around the net are from different versions that use very different syntax, etc....

    Ok, /rant.

    I'm trying to compile this as a generic plot of y = x^2 for the moment:
    histPlot.cpp:
    Qt Code:
    1. #include <qwt5/qwt_plot.h>
    2. #include <qwt5/qwt_plot_curve.h>
    3. #include "histPlot.h"
    4. #include <QWidget>
    5.  
    6. HistPlot::HistPlot( QWidget *parent ) : QwtPlot( parent)
    7. {
    8. // Show a title
    9. setTitle( "History" );
    10.  
    11. // Create curves
    12. QwtPlotCurve * curve = new QwtPlotCurve("Curve");
    13.  
    14. double x[100], y[100];
    15.  
    16. for (int i = 0; i < 100; i++){
    17. x[i] = i;
    18. y[i] = i*i;
    19. }
    20.  
    21. curve->setData(x,y,100);
    22. curve->attach(this);
    23.  
    24. // Show the plots
    25. replot();
    26.  
    27. }
    To copy to clipboard, switch view to plain text mode 
    But I get this from the compiler:
    g++ -o timeClock dialogs.o fileOps.o frame.o histPlot.o main.o mainWindow.o timeFunctions.o timeSheet.o moc_frame.o moc_histPlot.o moc_mainWindow.o -L/usr/lib64/qt4 -lqwt -lQtGui -L/usr/lib64 -L/usr/lib64/qt4 -L/usr/X11R6/lib64 -lpng -lSM -lICE -lXi -lXrender -lXrandr -lXinerama -lfreetype -lfontconfig -lXext -lX11 -lQtCore -lz -lm -lrt -ldl -lpthread
    moc_histPlot.o: In function `HistPlot::qt_metacall(QMetaObject::Call, int, void**)':
    moc_histPlot.cpp:(.text+0x11): undefined reference to `QwtPlot::qt_metacall(QMetaObject::Call, int, void**)'
    moc_histPlot.o: In function `HistPlot::qt_metacast(char const*)':
    moc_histPlot.cpp:(.text+0x58): undefined reference to `QwtPlot::qt_metacast(char const*)'
    moc_histPlot.o:(.rodata+0x0): undefined reference to `QwtPlot::staticMetaObject'
    collect2: ld returned 1 exit status
    make: *** [timeClock] Error 1
    Neither I nor google have any idea what qt_metacall is, nor why it can't be found. Any ideas?
    Last edited by jacek; 22nd January 2009 at 20:17. Reason: changed [code] to [quote]

Similar Threads

  1. Unable to install QT 4.4.0 from sources
    By debnathm in forum Installation and Deployment
    Replies: 4
    Last Post: 6th August 2008, 06:43
  2. how to add static library into qmake
    By Namrata in forum Qt Tools
    Replies: 1
    Last Post: 20th November 2007, 17:33
  3. MS Sql native driver??
    By LordQt in forum Qt Programming
    Replies: 4
    Last Post: 9th October 2007, 13:41
  4. error undefined reference ...............
    By amit_pansuria in forum Qt Programming
    Replies: 2
    Last Post: 8th June 2007, 14:28
  5. how to correctly compile threads support?
    By srhlefty in forum Installation and Deployment
    Replies: 9
    Last Post: 25th June 2006, 19:15

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.