QT5 r 加入qwtplot3d 三维库

 
 
 
qwtplot3d是基于QtOpenGL开发的,也是qwt库的三维库,我使用的是qwtplot3d-0.2.7.zip版本。

 

步骤跟编译qwt库一样(不明白可以看回前面写的一篇文章“QT5 qtcreator 加入qwt画图插件”),下面我把一些编译的问题汇总一下:

1)

include/qwt3d_openglhelper.h:8:26: fatal error: QtOpenGL/qgl.h: 没有那个文件或目录
 #include <QtOpenGL/qgl.h>

解决方案:
 ///// sudo apt-get install libqt5opengl5*


2)
include/qwt3d_openglhelper.h: In function ‘const GLubyte* Qwt3D::gl_error()’:
include/qwt3d_openglhelper.h:67:31: error: ‘gluErrorString’ was not declared in this scope
   err = gluErrorString(errcode);

解决方案:
   /////  在include/qwt3d_openglhelper.h这个文件里添加 #include <GL/glu.h>
   /////  记事本打开 qwtplot3d.pro , 在最前面输入下面这一句  LIBS += -lGLU



3)

解决方案:
打开./examples/mesh2/src/designerworkaround.h
#include <QtGui/QMenu> ==> #include <QMenu>
 .... 
  /////  去掉"QtGui/" 

 

 

最后安装一下编译出来的库:

sudo mkdir -p /usr/local/qwtplot3d
sudo cp -rf lib /usr/local/qwtplot3d
sudo ln -s /usr/local/qwtplot3d/lib/libqwtplot3d.so.0 /usr/lib/libqwtplot3d.so.0

原文地址:https://www.cnblogs.com/lvdongjie/p/4371551.html