【问题标题】:run qwt example in Qt 5 on linux ubuntu在 linux ubuntu 上的 Qt 5 中运行 qwt 示例
【发布时间】:2015-07-16 19:54:52
【问题描述】:

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

我像往常一样从here 下载文件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

请帮忙。

【问题讨论】:

    标签: c++ linux qt makefile qwt


    【解决方案1】:

    以下方法对我很有效:

    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
    

    【讨论】:

    • 成功了,谢谢。我该如何测试它?我看到需要在 pro 文件中添加行的示例,例如 /usr/local 中的 include 或 lib ???我那里没有 qwt 目录。下一步是什么?
    • 它的工作,我非常感谢一些帮助 - 这个标志做什么?我尝试在我的 arm 编译器中编译它,但没有成功。我应该在 qmake 或 make 中更改它吗?我已经在我的机器上安装了 arm 编译器,它在我的 qtcreator 中运行良好,但我无法在命令行中运行。
    • 我运行了这个命令,但文件仍然编译为 x86。 /opt/Qt5.4.1/5.4/gcc_64/bin/qmake QMAKE_CC=/opt/poky-qt/1.6.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky -linux-gnueabi-g++ qwt.pro -o build/Makefile QWT_CONFIG="QwtExamples"
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多