前题条件
完成osg 3.0的编译
Step 1 下载osgEarth 2.1.1
https://github.com/gwaldron/osgearth/downloads------------》https://github.com/gwaldron/osgearth/releases/tag/osgearth-2.5

                          ------------》http://osgearth.org/
Step 2 下载gdal 1.8.1并编译
下载地址:http://trac.osgeo.org/gdal/wiki/DownloadSource
编译方法:
运行vcvar32.bat
在gdal1.8.1的当前目录运行nmake /f makefile.vc MSVC_VER=1600
nmake /f makefile.vc install
nmake /f makefile.vc devinstall
最终结果在c:\warmerda下
Step 3 下载geos 3.3.2 并编译
下载地址:http://trac.osgeo.org/geos/
编译方法:
运行vcvar32.bat
双击运行autogen.bat
nmake /f makefile.vc MSVC_VER=1600
最终结果在c:\warmerda下

Step 4 下载SQLite 3.7.10
下载地址 :http://www.sqlite.org/download.html
建立一个静态链接工程,加入sqlite3开头的三个文件
建立一个exe工程,加入shell.c
将静态结果更名为sqlited.lib和sqlite.lib,分别表示debug和release版本
Step5 下载libzip的编译结果
下载地址:http://files.cnblogs.com/eaglezhao/libzip(vs10).rar
Step6 下载zlib并编译
下载地址:http://www.winimage.com/zLibDll/minizip.html
进入contrib\vstudio\vc10目录,双击工程进行编译。
step7 下载并编译proj 4
下载地址:http://trac.osgeo.org/proj/
编译方法
运行vcvar32.bat
nmake /f makefile.vc install
nmake /f makefile.vc install-all
step 8 使用cmake编译osgEarth
step 9 测试编译结果

详细编译步骤:

(1)将来自step1 下载的osgearth源文件解压到"019.Earth\builder\code\osgearth2.1.1\src"

(2)  将"019.Earth\builder\code\osg3.0\src"中3rdparty 拷贝到"019.Earth\builder\code\osgearth2.1.1”中

创建“019.Earth\builder\code\osgearth2.1.1\vc”文件夹

(3)编译"geos" 编译方法与GDAL编译方法相似,

  将vcvar32.bat拖进cmd窗口中

cd 进入到geos-3.3.2目录中

autogen.bat

  nmake /f makefile.vc MSVC_VER=1600

执行上述语句后

----------->如果是geos3.3.2版本将会报错"BufferOp.cpp<97> error c2668",新的版本不会报错

-----------》所要修改的内容是BufferOp.cpp 97 行 std::log(10)改为 std::log(10.0)

  提示编译成功,结果文件存放在"geos-3.3.2\src"中  -->geos.dll

                          -->geos.lib

                          -->geos_c_i.lib

                          -->geos_i.lib

                          -->geos_c.dll

将上述文件拷贝到"019.Earth\builder\runtime\geos3.3.2\bin“中

  将"geos-3.3.2\include"中文件拷贝到 "019.Earth\builder\runtime\geos3.3.2\include“中

   path 中添加 "builder->runtime->geos3.3.2->bin"

(4)编译SQLite 下载源文件(详细路径见step 4 )sqlite-amalgamation-3071000.zip

a.     解压下载的压缩文件(shell.c    sqlite3.c   sqlite3.h   sqlite3ext.h)到"*\sqlite-amalgamation-3071000\"目录

b.     需要建立两个工程,

      (b1)---------->VS2010->File->new->project->visual C++->win32 console application->Name( 输入 "sqlite" )->Location(输入"*\sqlite-amalgamation-3071000\")->点击"OK"->application settings选择"empty project" ->点击"Finish"

(b2)"Solution 'sqlit/1project'"右键->Add"New Project"->win32 console application->Name( 输入 "shell" )->OK->"Application Settings"(选中"Empty project")->"Finish"

(b3)修改"sqlite"项目类型:右键"Properties"->"Congiguration Properties"->"Configuration Type"(改为 "Static library(.lib)")->"Target Extension"(改为 ".lib")->点击"应用"            -----》注:debug release 两个版本都需要修改

(b4)Build->Batch Build->   shell Debug Win32 ->Build

shell Release Win32

sqlite Debug Win32

sqlite Debug Win32

(b5)shell->"source files"->add->Existing Item->"*\sqlite-amalgamation-3071000\shell.c"

(b6)sqlite->"source files"->add->Existing Item->"*\sqlite-amalgamation-3071000\sqlite3.c"

                             ->"*\sqlite-amalgamation-3071000\sqlite3.h"

                             ->"*\sqlite-amalgamation-3071000\sqlite3ext.h"

(b7)重复b4步骤

(b8)因为shell编译的时候需要链接到sqlite.lib,所以报错

(b9)"\sqlite-amalgamation-3071000\(shell.c    sqlite3.c   sqlite3.h   sqlite3ext.h)"   四个文件全部都拷贝到   "019.Earth\builder\runtime\sqlite3\include“

            "*\sqlite-amalgamation-3071000\sqlite\Debug\sqlite.lib"   拷贝到  "019.Earth\builder\runtime\sqlite3\bin“中并重命名为"sqlited.lib"

"*\sqlite-amalgamation-3071000\sqlite\release\sqlite.lib"   拷贝到  "019.Earth\builder\runtime\sqlite3\bin“

(b10)对shell工程进行链接:shell-》右键-》property pages->Linker->input->"Additional dependencies"->点击"Edit"---

          ->添加"019.Earth\builder\runtime\sqlite3\bin\sqlited.lib"(debug版)

->添加"019.Earth\builder\runtime\sqlite3\bin\sqlite.lib"(release版)

      (b11)Build->Batch Build->   shell Debug Win32 ->Build

shell Release Win32

(b12)进行shell工程生成的文件的拷贝:

        "*\sqlite-amalgamation-3071000\sqlite\Debug\shell.exe"   拷贝到  "019.Earth\builder\runtime\sqlite3\bin“中并重命名为"shelld.exe"

"*\sqlite-amalgamation-3071000\sqlite\Release\shell.exe"   拷贝到  "019.Earth\builder\runtime\sqlite3\bin“中

(b13)设置环境变量

path添加"019.Earth\builder\runtime\sqlite3\bin“

(5)MiniZip的编译:a.zlib:第三方库中"3rdparty/lib"包括"zlib1.lib zlib1d.lib"

b.libzip:可以通过step5下载到编译好的vs2010的版本(libzip(vs10).rar),将其解压,

将解压后的"libzip\(bin include lib man)"四个全部的文件夹 放到“3rdparty”文件夹中

(6)proj 4的编译:a.通过step7进行下载,下载结果为"proj-4.7.0.zip",进行解压,解压后文件夹为"proj-4.7.0";

b.cd 到  文件夹"proj-4.7.0"中,方法同编译GDAL

          nmake /f makefile.vc  MSVC_VER=1600

nmake /f makefile.vc install

          nmake /f makefile.vc install-all

                    c.最后的编译结果存放在"C:\PROJ"

将"C:\PROJ"拷贝到“019.Earth\builder\runtime\”  并将“PROJ”文件夹重命名为“PROJ4”

d.将“019.Earth\builder\runtime\PROJ4\bin” 添加到 path目录

(7)编译osgearth:  a.点击"cmake"            “where is the source code”->"019.Earth\builder\code\osgearth2.1.1\src"

"where to build the binaries"->“019.Earth\builder\code\osgearth2.1.1\vc”

         b.点击"Configure"按钮, 选择"Advanced","Specify the generatro for this project " 对话框中选择"Visual Studio 10" "Use default native compilers" 后点击"Finish"  弹出错误“Error in configuration process,project files may be invalid” ,点击"OK"

c.修复相关错误:

CURL_INCLUDE_DIR->"019.Earth/builder/code/osgearth2.1.1/3rdparty/include"

CURL_LIBRARY->"019.Earth/builder/code/osgearth2.1.1/3rdparty/lib/curllib.lib"

CURL_LIBRARY_DEBUG->"019.Earth/builder/code/osgearth2.1.1/3rdparty/lib/curllibd.lib"

GDAL_INCLUDE_DIR-> "019.Earth/builder/runtime/GDAL1.8.1/include"

GDAL_LIBRARY-> "019.Earth/builder/runtime/GDAL1.8.1/lib/gdal_i.lib"

GEOS_INCLUDE_DIR-> "019.Earth/builder/runtime/geos3.3.2/include"

GEOS_LIBRATY-> "019.Earth/builder/runtime/geos3.3.2/bin/geos.lib"

           GEOS_LIBRATY_DEBUG-> "019.Earth/builder/runtime/geos3.3.2/bin/geos_i.lib"

LIBZIP_INCLUDE_DIR->"019.Earth/builder/code/osgearth2.1.1/3rdparty/include"

LIBZIP_LIBRARY->"019.Earth/builder/code/osgearth2.1.1/3rdparty/lib/zip.lib"

OSG_INCLUDE_DIR->"019.Earth/builder/runtime/osg3.0/include"

ZLIB_INCLUDE_DIR->"019.Earth/builder/code/osgearth2.1.1/3rdparty/include"

ZLIB_LIBRARY->"019.Earth/builder/code/osgearth2.1.1/3rdparty/lib/zlib1.lib"

SQLITE3_INCLUDE_DIR->"019.Earth/builder/runtime/sqlite3/include"

SQLITE3_LIBRARY->"019.Earth/builder/runtime/sqlite3/bin/sqlite.lib"

OSG_DIR->"019.Earth/builder/runtime/osg3.0"

OSG_GEN_INCLUDE_DIR->"019.Earth/builder/runtime/osg3.0"

再次点击"Configure" ,minizip报错(step6 zlib中可能包含minizip)

忽略minizip错误,再次点击"Configure",无错误,点击"Generate"

"generate"完成后,打开“019.Earth\builder\code\osgearth2.1.1\vc”文件夹,启动"OSGEARTH.sln"

"Build"->"Batch Build" : 构建"ALL_BUILD"   "Debug"  "Debug|Win32"

                     构建"ALL_BUILD"   "Release"  "Release|Win32"

点击"BUILD"

编译成功 124个全部完成,

进行环境变量配置.

将 “019.Earth\builder\code\osgearth2.1.1\”中3rdparty 文件夹 拷贝到  "019.Earth/builder/runtime/osgearth"中

然后将"019.Earth/builder/runtime/osgearth/3rdparty/bin"  路径添加到 path中

将 “019.Earth\builder\code\osgearth2.1.1\src\src”中所有文件 拷贝到  "019.Earth/builder/runtime/osgearth/include"中

将  “019.Earth\builder\code\osgearth2.1.1\vc\lib\release”中所有.lib .dll文件 拷贝到 "019.Earth/builder/runtime/osgearth/lib"中

将  “019.Earth\builder\code\osgearth2.1.1\vc\lib\debug”中所有.lib .dll文件 拷贝到 "019.Earth/builder/runtime/osgearth/lib"中

将  “019.Earth\builder\code\osgearth2.1.1\vc\bin\debug”中所有.exe文件 拷贝到 "019.Earth/builder/runtime/osgearth/bin"中

将  “019.Earth\builder\code\osgearth2.1.1\vc\bin\release”中所有.exe文件 拷贝到 "019.Earth/builder/runtime/osgearth/bin"中

将 "019.Earth/builder/runtime/osgearth/lib" 中所有.dll文件 拷贝到"019.Earth/builder/runtime/osgearth/bin"中

然后将"019.Earth/builder/runtime/osgearth/bin" 放入path中

将"019.Earth\builder\code\osgearth2.1.1\src" 中data文件夹和tests文件夹 拷贝到 "019.Earth/builder/runtime/osgearth“文件夹中

重启电脑(??设置环境变量后)

cd 进入到 "019.Earth/builder/runtime/osgearth/tests” 目录

cd osgearth_viewer boston_buildings.earth(存在于"019.Earth/builder/runtime/osgearth/tests文件夹中)

运行成功后 osgearth 编译完成 所有的bin目录都会被设置环境变量

第一讲(3)osgearth编译的更多相关文章

  1. 《ArcGIS Engine+C#实例开发教程》第一讲桌面GIS应用程序框架的建立

    原文:<ArcGIS Engine+C#实例开发教程>第一讲桌面GIS应用程序框架的建立 摘要:本讲主要是使用MapControl.PageLayoutControl.ToolbarCon ...

  2. 32位汇编第一讲x86和8086的区别,以及OllyDbg调试器的使用

    32位汇编第一讲x86和8086的区别,以及OllyDbg调试器的使用 一丶32位(x86也称为80386)与8086(16位)汇编的区别 1.寄存器的改变 AX 变为 EAX  可以这样想,16位通 ...

  3. C++反汇编第一讲,认识构造函数,析构函数,以及成员函数

    C++反汇编第一讲,认识构造函数,析构函数,以及成员函数 以前说过在C系列下的汇编,怎么认识函数.那么现在是C++了,隐含有构造和析构函数 一丶认识构造函数 高级代码: class MyTest { ...

  4. python学习第一讲,python简介

    目录 python学习第一讲,python简介 一丶python简介 1.解释型语言与编译型语言 2.python的特点 3.python的优缺点 二丶第一个python程序 1.python源程序概 ...

  5. OSGEarth编译

    解决OSGEarth编译时出现error LNK1181: 无法打开输入文件“optimized.lib的问题 以下方案受到了osg大神qq网名为“阿威.小号”的帮助. 在采用Cmake3.6.2创建 ...

  6. CS193P - 2016年秋 第一讲 课程简介

    Stanford 的 CS193P 课程可能是最好的 ios 入门开发视频了.iOS 更新很快,这个课程的最新内容也通常是一年以内发布的. 最新的课程发布于2016年春季.目前可以通过 iTunes ...

  7. OSG+VS2010+win7环境搭建---OsgEarth编译

    OSG+VS2010+win7环境搭建---OsgEarth编译 转:http://www.cnblogs.com/hnfxs/p/3161261.html Win7下 osg+vs2010环境搭建 ...

  8. POI教程之第一讲:创建新工作簿, Sheet 页,创建单元格

    第一讲 Poi 简介 Apache POI 是Apache 软件基金会的开放源码函数库,Poi提供API给java程序对Microsoft Office格式档案读和写的功能. 1.创建新工作簿,并给工 ...

  9. osgEarth编译(转载)

    osgEarth编译 osgEarth的编译需要osg和一些第三方插件库,我主要参考了cnblogs上的一篇博文,但是也不够详细,并且我是在已经编译好osg的情况下去编译osgEarth,所以期间也遇 ...

随机推荐

  1. 【Java】【异常】

    java中2种方法处理异常:1.在发⽣异常的地方直接处理:2.将异常抛给调用者,让调⽤者处理.异常分类1.检查性异常: java.lang.Exception2.运⾏期异常: java.lang.Ru ...

  2. git 命令 clone分支的代码

    一个项目通常含有很多分支, master分支一般是经过测试,验证没有问题后,代码才会提交到master分支 develop分支,是测试经常拉下来进行测试的分支 直接复制develop分支的git 命令 ...

  3. JDBC Connection Configuration

    如果在Jmeter 中想用到连接数据库的功能,必须下载jar包,常见的关系型数据库jar包见以下共享链接 链接:https://pan.baidu.com/s/1t-k9RW141lw0j_QSw53 ...

  4. Oracle(限定查询2)

    3.2 对数据进行限定查询 在标准SQL之中定义了许多的运算符. 3.2.1.关系运算符 范例: 范例: 范例: 在使用关系运算符判断字符数据的时候注意大小写的编写问题.因为Oracle是区分大小写的 ...

  5. 一个sql实现查询并且插入到另一个表中

    两种不同方法,结果不同 方法一.查询的user表中3个元素,name为user表中的字段,1000,0,是往department中要赋的值(给id赋值) ,`name`,' 方法二(推荐使用方法二): ...

  6. Mac Python PyQt5 环境搭建

    pip install pyqt5 测试开发环境 在Terminal里敲下以下代码,如果没有报错就说明安装成功了. python -c "import PyQt5" 或是如下图,导 ...

  7. NGUI实现UITexture的UV滚动

    材质上使用的贴图: 效果:实现该纹理在屏幕上的滚动 代码: using System.Collections; using System.Collections.Generic; using Unit ...

  8. 安装edusoho

    1.更新第三方源并升级系统 (CentOS默认的标准源里没有nginx软件包) 1.1.安装CentOS第三方yum源 #安装下载工具wget yum install wget #下载atomic y ...

  9. 为 昂达 v891 安装上了 remix OS 了

    起因: 默认的ROM自带一堆垃圾app,最主要的是没有root , 所以卸载不了. 然后试了 Root大师 , 刷机精灵 之类的软件. 我 CTMD , 简直比出厂ROM 还流氓, 不断的强制安装各种 ...

  10. Getting Started with Processing 第四章总结

    为什么要使用变量: 我们使用变量的一个重要原因就是避免变成过程中的重复工作,如果你重复使用某一个数字超过了一次,就可以考虑使用一个变量来代替它,这样你的程序会更加通用并且易于更新. 定义变量 定义变量 ...