我是靠谱客的博主 现代饼干,这篇文章主要介绍Windows10 编译 QWTPlot3d,现在分享给大家,希望可以做个参考。

Windows10 编译 QWTPlot3d

下载:
qwtplot3d-0.2.7.zip (2020.12.21)
http://qwtplot3d.sourceforge.net/

解压, 用Qt打开,进行编译

报错:
error: dependent ‘…qwtplot3dincludeglGLU.H’ does not exist.

qwtplot3d.pro文件,修改该文件部分内容:

复制代码
1
2
win32:TEMPLATE = vclib

修改为:

复制代码
1
2
3
#win32:TEMPLATE = vclib win32:TEMPLATE = lib

并在 qwtplot3d.pro 最末端 添加:

复制代码
1
2
LIBS+=-lopengl32 -lglu32 –lglut

qwtplot3dincludeqwt3d_openglhelper.h:67:
error: C3861: “gluErrorString”: 找不到标识符

下载glu库(WindowsSDK自带的编译不过),放入指定目录,并在qwt3d_openglhelper.h中添加:

复制代码
1
2
3
#include "gl/GL.h" #include "gl/GLU.h"

其它:
gl.h文件错误
glgl.h(1152): error C2144: 语法错误:“void”的前面应有“;”
等错误,
则需要包含 windows.h

复制代码
1
2
3
4
#include <windows.h> //Windows Header #include <glgl.h> //OpenGL Header #include <glglu.h> //GLu32 Header

来源:
https://blog.csdn.net/weixin_30709635/article/details/95877142

编译成功了,但发现生成的 lib 目录下只有 dll 文件,而没有 lib 文件
解决方法:
在 pro 文件中找到

复制代码
1
2
win32:dll:DEFINES += QT_DLL QWT3D_DLL QWT3D_MAKEDLL

增加一项

复制代码
1
2
win32:dll:DEFINES += QT_DLL QWT3D_DLL QWT3D_MAKEDLL Q_WS_WIN

编译示例程序 :

打开工程:
examplesexamples.pro

编辑
examplesautoswitchcommoncommon.pro

复制代码
1
2
TEMPLATE = vcapp

复制代码
1
2
QMAKE_LFLAGS +=/NODEFAULTLIB:msvcrt

注释掉

再编译examples
出错提示:
error: LNK1104: 无法打开文件“…libqwtplot3d.lib”

将qwtplot3d编译的lib进行链接即可(根据情况修改common.pro的链接路径)

再编译出错:
examplesmesh2srcdesignerworkaround.h:16: error: unknown type name ‘QMenuBar’
designerworkaround.h中, 将

复制代码
1
2
3
4
5
6
7
8
#include <QtGui/QMenu> #include <QtGui/QToolBar> #include <QtGui/QAction> #include <QtGui/QActionGroup> #include <QtGui/QMainWindow> #include <QtGui/QComboBox> #include <QtGui/QMenuBar>

改为

复制代码
1
2
3
4
5
6
7
8
#include <QMenu> #include <QToolBar> #include <QAction> #include <QActionGroup> #include <QMainWindow> #include <QComboBox> #include <QMenuBar>

其它参考:
qwtplot3d安装配置过程_xiaoyu_luobei的博客-CSDN博客_qwtplot3d安装

https://blog.csdn.net/xiaoyu_luobei/article/details/78618435

Qt使用qwtplot3d绘制3D曲面_billy的博客-CSDN博客_qt绘制三维曲面

https://blog.csdn.net/qq_34139994/article/details/108436295

在这里插入图片描述

最后

以上就是现代饼干最近收集整理的关于Windows10 编译 QWTPlot3d的全部内容,更多相关Windows10内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(66)

评论列表共有 0 条评论

立即
投稿
返回
顶部