1
  1. Build and installation
qmake qwt.pro
make
sudo make install
  1. Configure

2.1. add the following lines to .bashrc:

        export QWT_ROOT="/usr/local/qwt-6.2.0"
        QT_PLUGIN_PATH="${QWT_ROOT}/plugins:$QT_PLUGIN_PATH"
        export QT_PLUGIN_PATH

2.2. add the line to /etc/ld.so.conf.d/qwt.conf: /usr/local/qwt-6.2.0/lib

  1. Imput to console: qmake -set QMAKEFEATURES ${QWT_ROOT}/features
  2. Create project

DeleteMe.pro

QT += quick

#add QWT
CONFIG += qwt

INCLUDEPATH += /usr/local/qwt-6.2.0/include
LIBS += -L/usr/local/qwt-6.2.0/lib -lqwt

SOURCES += \
        main.cpp
...

main.cpp

#include <QGuiApplication>
#include <QQmlApplicationEngine>

#include <QwtPlot>
#include <QwtText>

int main(int argc, char *argv[])
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
    QGuiApplication app(argc, argv);

    QwtPlot plot(QwtText("Qwt example"));
    plot.setGeometry(0,0,640, 300);
    plot.show();

    return 0;
}

When I compile, i got the errors:

:-1: error: main.o: undefined reference to symbol '_ZN7QWidget4showEv@@Qt_5'
:-1: error: /lib/x86_64-linux-gnu/libQt5Widgets.so.5: error adding symbols: DSO missing from command line

Please help me to run the program

Kto To
  • 434
  • 5
  • 11
  • 2
    I think your problem is `QT += quick` but I am not a QMake expert. I think it should be `QT += widgets` instead. Your code is not using QtQuick or qml – drescherjm Oct 20 '22 at 13:09

0 Answers0