VS2015+qgis3.14+qt环境搭建(不用自己编译)

现在网上环境搭建多为qgis2.18等低版本,且大多数要求自己编译,一般自己编译老是出各种问题,最后无奈放弃。。。
1.vs中添加qt插件
在这里插入图片描述

2.环境配置
注意:要在release下配置:
在这里插入图片描述

在c/c++中配置附件包含目录:
在这里插入图片描述
F:\OSGeo4W64\apps\qgis\include
F:\OSGeo4W64\include
F:\OSGeo4W64\apps\Qt5\include
F:\OSGeo4W64\apps\Qt5\include\QtXml//qgis必加
F:\OSGeo4W64\apps\Qt5\include\QtCore
F:\OSGeo4W64\apps\Qt5\include\QtGui
F:\OSGeo4W64\apps\Qt5\include\QtSerialPort//串口通信必加
//------选择性加,缺了再找-----------------------------
F:\OSGeo4W64\apps\Qt5\include\QtNetwork
F:\OSGeo4W64\apps\Qt5\include\QtWebKitWidgets
F:\OSGeo4W64\apps\Qt5\include\QtWidgets
F:\OSGeo4W64\apps\Qt5\include\qwt6
F:\OSGeo4W64\apps\Qt5\include\QtWebKit
F:\OSGeo4W64\apps\Qt5\include\QtCrypto
在链接器中配置lib
在这里插入图片描述

F:\OSGeo4W64\apps\Qt5\lib
F:\OSGeo4W64\apps\qgis\lib
F:\OSGeo4W64\lib

在链接库->输入中配置附加依赖项

在这里插入图片描述
Qt5Core.lib
Qt5Gui.lib
qgis_core.lib
qgis_app.lib
qgis_gui.lib
Qt5Widgets.lib
Qt5Xml.lib//qt中用qgis需要加
Qt5SerialPort.dll//如果要用qt自带的串口通信需要加
//—选择性加,缺了再找----------------
qtmain.lib
qgis_3d.lib
qgis_analysis.lib
qgis_native.lib
qgis_server.lib

3.配置系统环境:
在这里插入图片描述
4测试:
放入一些头文件,看程序能否找到:
//qt
#include <qmessagebox.h>
//gis
#include <qgsvectorlayer.h>
#include <qgsrasterlayer.h>
#include <qgsmapcanvas.h>
#include <qgsrasterlayer.h>
#include<qgsCoordinatetransform.h>
#include<qgsapplication.h>
#include<qgsproviderregistry.h>
#include<qgsmaplayerref.h>
#include<qgsmaplayerrenderer.h>
#include<qgsauthimportcertdialog.h>

///

#include<QtWidgets/QApplication>
#include<qgsapplication.h>
#include<qgsproviderregistry.h>
#include<qgsmaplayerregistry.h>
#include<qgsvectorlayer.h>
#include<qgsmapcanvas.h>

#include <qgssymbollayer.h>
#include <qgssymbol.h>
#include <qgsmarkersymbollayer.h>
#include <qgsvectorlayerrenderer.h>
#include <qgsrendercontext.h>
#include <qgssinglesymbolrenderer.h>
#include <qgssymbollayer.h>

测试程序可以下载我写过的代码:1.https://download.csdn.net/download/xx970829/13094093
2.https://download.csdn.net/download/xx970829/13095254
3.https://download.csdn.net/download/xx970829/13105421
。。。。。。。
5.常见问题:
vs+qt+qgis环境搭建常见问题及解决方案:
https://editor.csdn.net/md/?articleId=109891607

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值