Problem with the installation of the Qwt (Qt6 installed from source)
-
Hi, Qt'ers
I have Qt6 (6.5) built from source and I am trying to install the Qwt library according to this guide: https://qwt.sourceforge.io/qwtinstall.html
/home/lparadox/Tools/qt/qt6-install/bin/qmake qwt.pro
make -j8
and I'm getting the error:
cd src/ && ( test -e Makefile || /home/lparadox/Tools/qt/qt6-install/bin/qmake -o Makefile /home/lparadox/Tools/qt/qwt-6.2.0/src/src.pro ) && make -f Makefile make[1]: Entering directory '/home/lparadox/Tools/qt/qwt-6.2.0/src' moc qwt_dyngrid_layout.h compiling qwt_dyngrid_layout.cpp compiling qwt_magnifier.cpp compiling qwt_panner.cpp compiling qwt_picker.cpp compiling qwt_symbol.cpp qwt_symbol.cpp:20:10: fatal error: qsvgrenderer.h: No such file or directory 20 | #include <qsvgrenderer.h> | ^~~~~~~~~~~~~~~~ compilation terminated. make[1]: *** [Makefile:1453: obj/qwt_symbol.o] Error 1 make[1]: Leaving directory '/home/lparadox/Tools/qt/qwt-6.2.0/src' make: *** [Makefile:53: sub-src-make_first-ordered] Error 2
I see the
qsvgrenderer.h
is present. Is this problem about the Qt version ? -
@SGaist Hi
I added
QT += svg
inqwt.pro
-- the same error BUT the message now is a bit different :cd src/ && ( test -e Makefile || /home/lparadox/Tools/qt/qt6-install/bin/qmake -o Makefile /home/lparadox/Tools/qt/qwt-6.2.0/src/src.pro ) && make -f Makefile make[1]: Entering directory '/home/lparadox/Tools/qt/qwt-6.2.0/src' /usr/lib/qt5/bin/qmake -o Makefile src.pro Project WARNING: QwtSvg is enabled in qwtconfig.pri, but Qt has not been built with svg support compiling qwt_symbol.cpp compiling qwt_text_label.cpp compiling qwt_spline_curve_fitter.cpp compiling qwt_weeding_curve_fitter.cpp moc qwt_abstract_legend.h moc qwt_legend.h compiling qwt_legend_data.cpp moc qwt_legend_label.h qwt_symbol.cpp:20:10: fatal error: qsvgrenderer.h: No such file or directory 20 | #include <qsvgrenderer.h> | ^~~~~~~~~~~~~~~~ compilation terminated. make[1]: *** [Makefile:1447: obj/qwt_symbol.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: Leaving directory '/home/lparadox/Tools/qt/qwt-6.2.0/src' make: *** [Makefile:53: sub-src-make_first-ordered] Error 2
I tried to disable
QwtSvg
inqwtconfig
by commenting this line ( I will try to compile Qt with svg enabled later) :QWT_CONFIG += QwtSvg
Then
make
. The library seems to compile but the examples give errors :... linking ../bin/animation compiling Plot.cpp moc CpuPlot.h /usr/bin/ld: obj/Plot.o: in function `Plot::updateCurves()': Plot.cpp:(.text+0xf9): undefined reference to `QwtPlotCurve::setSamples(QList<QPointF> const&)' /usr/bin/ld: obj/Plot.o: in function `Curve::updateSamples(double)': Plot.cpp:(.text._ZN5Curve13updateSamplesEd[_ZN5Curve13updateSamplesEd]+0x4c): undefined reference to `QwtPlotCurve::setSamples(QList<QPointF> const&)' collect2: error: ld returned 1 exit status make[2]: *** [Makefile:364: ../bin/animation] Error 1 make[2]: Leaving directory '/home/lparadox/Tools/qt/qwt-6.2.0/examples/animation' make[1]: *** [Makefile:72: sub-animation-make_first] Error 2 make[1]: *** Waiting for unfinished jobs.... compiling Plot.cpp linking ../bin/barchart linking ../bin/distrowatch /usr/bin/ld: obj/BarChart.o: in function `BarChart::populate()': BarChart.cpp:(.text+0x55e): undefined reference to `QwtPlotMultiBarChart::setSamples(QList<QList<double> > const&)' collect2: error: ld returned 1 exit status make[2]: *** [Makefile:364: ../bin/barchart] Error 1 make[2]: Leaving directory '/home/lparadox/Tools/qt/qwt-6.2.0/examples/barchart' make[1]: *** [Makefile:97: sub-barchart-make_first] Error 2 linking ../bin/friedberg /usr/bin/ld: obj/BarChart.o: in function `BarChart::BarChart(QWidget*)': BarChart.cpp:(.text+0xfed): undefined reference to `QwtPlotBarChart::setSamples(QList<double> const&)' collect2: error: ld returned 1 exit status make[2]: *** [Makefile:364: ../bin/distrowatch] Error 1 make[2]: Leaving directory '/home/lparadox/Tools/qt/qwt-6.2.0/examples/distrowatch' make[1]: *** [Makefile:172: sub-distrowatch-make_first] Error 2 compiling Editor.cpp /usr/bin/ld: obj/Plot.o: in function `Plot::insertCurve(QString const&, QList<QPointF> const&, QColor const&)': Plot.cpp:(.text+0x17b): undefined reference to `QwtPlotCurve::setSamples(QList<QPointF> const&)' /usr/bin/ld: obj/Plot.o: in function `Plot::insertErrorBars(QString const&, QList<QwtIntervalSample> const&, QColor const&)': Plot.cpp:(.text+0x28e): undefined reference to `QwtPlotIntervalCurve::setSamples(QList<QwtIntervalSample> const&)' collect2: error: ld returned 1 exit status make[2]: *** [Makefile:368: ../bin/friedberg] Error 1 make[2]: Leaving directory '/home/lparadox/Tools/qt/qwt-6.2.0/examples/friedberg' make[1]: *** [Makefile:197: sub-friedberg-make_first] Error 2 linking ../bin/legends /usr/bin/ld: obj/Plot.o: in function `Plot::insertCurve()': Plot.cpp:(.text+0x7e4): undefined reference to `QwtPlotCurve::setSamples(QList<QPointF> const&)' collect2: error: ld returned 1 exit status make[2]: *** [Makefile:373: ../bin/legends] Error 1 make[2]: Leaving directory '/home/lparadox/Tools/qt/qwt-6.2.0/examples/legends' make[1]: *** [Makefile:247: sub-legends-make_first] Error 2 linking ../bin/cpuplot make[2]: Leaving directory '/home/lparadox/Tools/qt/qwt-6.2.0/examples/cpuplot' linking ../bin/itemeditor make[2]: Leaving directory '/home/lparadox/Tools/qt/qwt-6.2.0/examples/itemeditor' make[1]: Leaving directory '/home/lparadox/Tools/qt/qwt-6.2.0/examples' make: *** [Makefile:225: sub-examples-make_first-ordered] Error 2
-
@LRDPRDX
I do not understand what you are showing now. In the first paste there is an error during compilation on#include <qsvgrenderer.h>
, in the second block it seems to have got past compilation and has undefined references during linking.For the
#include <qsvgrenderer.h>
error, because it is inside< ... >
the compiler will only seek this file in a directory passed on the command line via-I/home/lparadox/Tools/qt/qt6-install/include/QtSvg
, it will not look in the current directory. That may be relevant to your situation. -
You should try a clean build (delete the build directory by hand and start over). Maybe the examples will compile then.
I am not sure how current the documentation is (https://qwt.sourceforge.io/index.html), but it states:
Qwt 6.2 might be usable in all environments where you find Qt. It is compatible with Qt 4.8 and all Qt5 versions.
and
Active development will happen in the develop branch supporting Qt >= 5.6 and relying on at least C++11. However all versions >= Qt 4.8 will actively be supported in the 6.x branches.
I am not sure if Qt 6 is supported by Qwt (but it might still work). Has anyone better information about this?
-
@SimonSchroeder said in Problem with the installation of the Qwt (Qt6 installed from source):
I am not sure if Qt 6 is supported by Qwt (but it might still work). Has anyone better information about this?
Don't know. Googling doesn't show much, a couple of references like
- https://packages.fedoraproject.org/pkgs/qwt/qwt-qt6-devel/ --- so someone got it working under Fedora?
- https://sourceforge.net/p/qwt/feature-requests/100/ --- managed it in 2022 with
Ok thats weird. I've just successfully compiled and linked Qwt with Qt6 by using a plain old "add_library" command instead of the "qt_add_library" version... Why this suddenly worked? I have no idea. Signals got generated in both versions...
?
Oh, see also https://forum.qt.io/topic/152458/qwt-widgets-not-showing-qt-designer
my qt version is 6.3.1 and qwt verison 6.1.6
That's Windows, but should indicate that has been made to work at least?
-
@JonB Ok. Let me explain. First I am saying that adding
QT += svg
gives the same error and showing the output with that error. But as I said the error message was a bit different. Because of the new message I removed theQWT_CONFIG += QwtSvg
line from theqwtconfig.pri
and that error disappeared. The compilation passed that erroneous point but the examples failed to link. -
-