QT Linux下编译qwt3d

原文链接

 

1、从下面网址下载bug fix版本的qwtplot3d

https://sourceforge.net/p/qwtplot3d/code/HEAD/tree/branches/multiple_curves_0_2_x/

 

 2、解压刚刚下载的文件,用Qt打开目录下的qwtplot3d.pro工程文件。选择release模式进行编译,编译过程会有一些warning,不要理会,最终会生成所需要的动态链接库文件

如果提示 找不到 zlib.h 头文件,则执行命令:

sudo apt-get install zlib1g-dev

3、将上面生成的4个lib文件复制到Qt的安装目录lib下,这样编译 的时候就能搜索到链接库了

 

我的路径

 

 

 4、执行完上面步骤后,现在打开一个例子,在解压后的源文件了有examles,打开里面的mesh2例子,进行编译。

修改example文件下common.pri文件第9行代码如下:

#unix:LIBS += -lqwtplot3d -L../../lib
unix:LIBS += -lqwtplot3d -L/home/kindy/Qt5.12.4/5.12.4/gcc_64/lib -lGLU -lz


即自定义共享库所在路径,以及添加GLU共享库,否则会报诸如

liqwtplot3d.so: undefined reference togluNewQuadric'
libqwtplot3d.so: undefined reference togluUnProject'
error: undefined reference to ‘gluDisk'
undefined reference togluQuadricDrawStyle'
libqwtplot3d.so: undefined reference togluCylinder'
等错误

5、官方例子效果

 

posted @ 2023-03-07 16:30  雾枫  阅读(159)  评论(0编辑  收藏  举报