关于最近编译QGIS一些总结

来源:互联网 发布:战争雷霆 海战 知乎 编辑:程序博客网 时间:2024/05/22 10:58


环境:

操作系统: Mac OSX 10.11.3

IDE:         Xcode7.2.1

CMake   Ver:  3.5.2

QGIS     Ver:   2.8.7


基本的过程就是,下载QGIS的源码,地址:

http://qgis.org/downloads/


找到2.8.7版本,然后下载

qgis-2.8.7.tar.bz2文件解压缩



解压缩后的文件名为qgis-2.8.7 

首先进入qgis-2.8.7  文件夹  打开 INSTALL 文件。

看一下里面的内容,最重要的是” 2. Overview”


Required build tools:


- CMake >= 2.8.6

- Flex >= 2.5.6

- Bison >= 2.4


Required build dependencies:


- Qt >= 4.7.0

- Proj >= 4.4.x

- GEOS >= 3.0

- Sqlite3 >= 3.0.0

- GDAL/OGR >= 1.4.x

- Qwt >= 5.0 & (< 6.1 with internal QwtPolar)

- expat >= 1.95

- QScintilla2


Optional dependencies:


- for GRASS plugin - GRASS >= 6.0.0 (libraries compiled with exceptions support on Linux 32bit)

- for georeferencer - GSL >= 1.8

- for postgis support and SPIT plugin - PostgreSQL >= 8.0.x

- for gps plugin - gpsbabel

- for mapserver export and PyQGIS - Python >= 2.3 (2.5+ preferred)

- for python support - SIP >= 4.12, PyQt >= 4.8.3 must match Qt version, Qscintilla2

- for qgis mapserver - FastCGI

- for oracle provider - Oracle OCI library



按照上面的要求下载依赖库,并编译。


在qgis的编译过程中,基本上所有的问题都来自于依赖库的缺失或者不匹配。



1.先用CMake 打开qgis-2.8.7的CMakeList.txt文件

2.看里面的依赖,然后都做相应的匹配。只需要添加”Required build dependencies:”  里面的就可以了。

比如: 


以上依赖中最需要注意的就是Qwt了。

亲测:Qwt6.1.2 + Qt5.5.0 没问题,Qwt6.2.0 + Qt5.5.0是有问题的,运行时报错找不到libqwt.so.6.2.0.


其他的一切正常。

虽然说着简单,但是其中多少辛酸。有问题可交流qq群:533948446

0 0
原创粉丝点击