5.Windows下编译OSG+OSGEARTH编译指南

OSG

官方网站

http://www.openscenegraph.org/

编译

下载OpenSceneGraph-3.4.0,OpenSceneGraph-Data-3.4.0,3rdParty_VS2013_v120_x86_x64_V9_full。
  三个文件夹都解压到本地,打开OpenSceneGraph-3.4.0/CMakeLists.txt,头部加入,之后使用cmake-gui生成sln即可。(需要指定3rdParty的路径。)

set(DESIRED_QT_VERSION "5" CACHE STRING "")
set(CMAKE_PREFIX_PATH "E:\\Qt\\Qt5.7.0\\5.7\\msvc2013_64" CACHE PATH "")

Geos

官方网站

https://github.com/libgeos/libgeos

编译

下载3.5版本
  根目录新建文件geos_svn_revision.h,输入:

#define GEOS_SVN_REVISION 4086

执行编译命令

nmake /f makefile.vc MSVC_VER=1800
nmake /f makefile.vc MSVC_VER=1800 DEBUG=1

ZLIB

官方网站

https://www.sqlite.org/

编译

LIB /DEF:sqlite3.def /machine:X64

OSGEarth

官方网站

http://osgearth.org/

编译

配置CMakeList.txt,头部加入

set(DESIRED_QT_VERSION "5" CACHE STRING "")
set(CMAKE_PREFIX_PATH "E:\\Qt\\Qt5.7.0\\5.7\\msvc2013_64" CACHE PATH "")
set(ZLIB_INCLUDE_DIR "E:\\code\\OSG\\3rdParty_x86_x64\\include")
set(ZLIB_LIBRARY "E:\\code\\OSG\\3rdParty_x86_x64\\lib")

修改:

SET(THIRD_PARTY_DIR "E:\\code\\OSG\\3rdParty_x86_x64" CACHE PATH "OSG 3rd-party dependency folder")

根据CMake-Gui配置osg,qt,zlib,protobuf,geos,gdal.

编译错误

  1. gdal的debug版本为gdal_i.lib
  2. 勾上 osgearth->property->Linker->Input->Additional Dependencies->inherit from parent or project defaults

你可能感兴趣的:(5.Windows下编译OSG+OSGEARTH编译指南)