symbol lookup error, undefined symbol: _ZN9QMetaType22



  • Hello !!!
    I have a linux app that uses QCustomPlot.
    When i click on plots' axis, app is going to die, and the error appears:

    "C:/SysGCC/Beaglebone/arm-linux-gnueabihf/sysroot/usr/local/qt5/examples/quick/demos/untitled2: symbol lookup error: C:/SysGCC/Beaglebone/arm-linux-gnueabihf/sysroot/usr/local/qt5/examples/quick/demos/untitled2: undefined symbol: _ZN9QMetaType22registerNormalizedTypeERK10QByteArrayPFvPvEPFS3_S3_PKvEi6QFlagsINS_8TypeFlagEEPK11QMetaObject"

    Does anybody know what is the reason of this?


  • Qt Champions 2016

    You mean that the application starts, and only after clicking someplace on the screen it dies with that error?



  • exactly, you're right! And these places are axis of QCustomPlot (marked pinky) alt text


  • Qt Champions 2016

    Apparently there's a call to:

    QMetaType::registerNormalizedType(QByteArray const&, void (*)(void*), void* (*)(void*, void const*), int, QFlags<QMetaType::TypeFlag>, QMetaObject const*)
    

    which can't be resolved, but that's a mighty strange error to get during runtime. Can you post some code of how you setup the plot?



  • ui_mainwindow.h

    #include <../../qcustomplot.h>
    class Ui_MainWindow
    {
    public:
        ...stuff...
        QCustomPlot *customPlot;
    .....
    }
    
    void setupUi(QMainWindow *MainWindow)
    {
    ...stuff....
     customPlot = new QCustomPlot(centralWidget);
            customPlot->setObjectName(QStringLiteral("customPlot"));
            customPlot->setGeometry(QRect(10, 50, 1251, 451));
    customPlot->setSizePolicy(sizePolicy);
     customPlot->setFont(font);
            customPlot->setFocusPolicy(Qt::ClickFocus);
    ...stuff....
    }
    

    ui_mainwinw.cpp

    MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent),
        ui(new Ui::MainWindow)
    {
    .....stuff...
        ui->customPlot->xAxis->setRange(-8, 600);
        ui->customPlot->yAxis->setRange(-5, 110);
       ui->customPlot->clearGraphs();
    ...stuff....
    }
    

    updategraph.cpp

    {
     ui->customPlot->addGraph();
        ui->customPlot->graph()->setName("graph #1");
        ui->customPlot->graph()->setData(xx1, yy1);
    ui->customPlot->replot();
    }
    

  • Qt Champions 2016

    I don't see anything obviously wrong. Is it possible you have an outdated build of QCustomPlot (e.g. if you upgraded Qt, but didn't update QCustomPlot)? Also is it possible you updated QCustomPlot but didn't rebuild your application (their code isn't binary compatible)? And finally, could you pull a stack trace when the error occurs?



  • @kshegunov
    thanks for answer,
    i've played with versions of QCustomPlot (downloaded an older versions) and it brings no results, the error still kills my app... i dont know about stack trace



  • @Andrey-Shmelew
    any idea how to hack it? for example, place a transparent rectangle on axis. It should not allow to touch the axis.. I know its not good


  • Qt Champions 2016

    Well, I still think it's some kind of incompatibility between versions. What about building QCustomPlot yourself? You should also be able to extract a stack trace from the app when you run it in debug mode. After the crash there's a "call stack" (or something like this) in the debug view of Creator.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.