- Build and installation
qmake qwt.pro
make
sudo make install
- 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
- Imput to console:
qmake -set QMAKEFEATURES ${QWT_ROOT}/features
- 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