在linux ubuntu的Qt 5中运行qwt示例

run qwt example in Qt 5 on linux ubuntu

本文关键字:运行 qwt 示例 Qt linux ubuntu      更新时间:2023-10-16

我不知道我需要做什么来运行使用Qwt库的示例程序。

我像往常一样从这里下载文件qwt-6.1.2.tar.bz2,它进入下载目录,我将文件解压缩到这个目录。我现在在下载目录中有qwt-6.1.2目录。

Qt目录在我的机器位于/opt/Qt5.4.1/

我如何从这里继续?

我尝试运行qmake:

natile@natile-Precision-T1650:/opt/Qt5.4.1/5.4/gcc_64/bin$ sudo ./qmake /home/natile/Downloads/qwt-6.1.2/qwt.pro

然后我运行make:

natile@natile-Precision-T1650:/opt/Qt5.4.1/5.4/gcc_64/bin$ sudo make

但是我得到一个错误:

cd src/ && ( test -e Makefile || /opt/Qt5.4.1/5.4/gcc_64/bin/qmake /home/natile/Downloads/qwt-6.1.2/src/src.pro -o Makefile ) && make -f Makefile

make[1]: Entering directory `/opt/Qt5.4.1/5.4/gcc_64/bin/src'
compiling /home/natile/qtcreator-projects/qwt/qwt-5.2/src/qwt_abstract_scale_draw.cpp
In file included from /home/natile/qtcreator-projects/qwt/qwt-5.2/src/qwt_abstract_scale_draw.cpp:19:0:
/home/natile/qtcreator-projects/qwt/qwt-5.2/src/qwt_scale_map.h:92:5: error: ‘QT_STATIC_CONST’ does not name a type
/home/natile/qtcreator-projects/qwt/qwt-5.2/src/qwt_scale_map.h:93:5: error: ‘QT_STATIC_CONST’ does not name a type
make[1]: *** [obj/qwt_abstract_scale_draw.o] Error 1
make[1]: Leaving directory `/opt/Qt5.4.1/5.4/gcc_64/bin/src'
make: *** [sub-src-make_first-ordered] Error 2

我明白我必须运行qmake.

安装URL: http://qwt.sourceforge.net/qwtinstall.html

请帮。

下面的方法很适合我:

cd /home/natile/Downloads/qwt-6.1.2/
mkdir build
/opt/Qt5.4.1/5.4/gcc_64/bin/qmake qwt.pro -o build/Makefile QWT_CONFIG="QwtExamples"
cd build
make
cd examples/bin
# Now you can launch any example, like:
./dials