第一讲(3)osgearth编译
前题条件
完成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编译的更多相关文章
- 《ArcGIS Engine+C#实例开发教程》第一讲桌面GIS应用程序框架的建立
原文:<ArcGIS Engine+C#实例开发教程>第一讲桌面GIS应用程序框架的建立 摘要:本讲主要是使用MapControl.PageLayoutControl.ToolbarCon ...
- 32位汇编第一讲x86和8086的区别,以及OllyDbg调试器的使用
32位汇编第一讲x86和8086的区别,以及OllyDbg调试器的使用 一丶32位(x86也称为80386)与8086(16位)汇编的区别 1.寄存器的改变 AX 变为 EAX 可以这样想,16位通 ...
- C++反汇编第一讲,认识构造函数,析构函数,以及成员函数
C++反汇编第一讲,认识构造函数,析构函数,以及成员函数 以前说过在C系列下的汇编,怎么认识函数.那么现在是C++了,隐含有构造和析构函数 一丶认识构造函数 高级代码: class MyTest { ...
- python学习第一讲,python简介
目录 python学习第一讲,python简介 一丶python简介 1.解释型语言与编译型语言 2.python的特点 3.python的优缺点 二丶第一个python程序 1.python源程序概 ...
- OSGEarth编译
解决OSGEarth编译时出现error LNK1181: 无法打开输入文件“optimized.lib的问题 以下方案受到了osg大神qq网名为“阿威.小号”的帮助. 在采用Cmake3.6.2创建 ...
- CS193P - 2016年秋 第一讲 课程简介
Stanford 的 CS193P 课程可能是最好的 ios 入门开发视频了.iOS 更新很快,这个课程的最新内容也通常是一年以内发布的. 最新的课程发布于2016年春季.目前可以通过 iTunes ...
- OSG+VS2010+win7环境搭建---OsgEarth编译
OSG+VS2010+win7环境搭建---OsgEarth编译 转:http://www.cnblogs.com/hnfxs/p/3161261.html Win7下 osg+vs2010环境搭建 ...
- POI教程之第一讲:创建新工作簿, Sheet 页,创建单元格
第一讲 Poi 简介 Apache POI 是Apache 软件基金会的开放源码函数库,Poi提供API给java程序对Microsoft Office格式档案读和写的功能. 1.创建新工作簿,并给工 ...
- osgEarth编译(转载)
osgEarth编译 osgEarth的编译需要osg和一些第三方插件库,我主要参考了cnblogs上的一篇博文,但是也不够详细,并且我是在已经编译好osg的情况下去编译osgEarth,所以期间也遇 ...
随机推荐
- python学习 day013打卡 内置函数
本节主要内容: 内置函数: 内置函数就是python给你提供的.拿来直接用的函数,比如print,input等等.截止到python版本3.6.2 python一共提供了68个内置函数.他们就是pyt ...
- python学习 day07打卡 文件操作
本节主要内容: 初识文件操作 只读(r,rb) 只读(w,wb) 追加(a,ab) r+读写 w+写读 a+追加写读 其他操作方法 文件的修改以及另一种打开文件句柄的方法 一. 初识文件操作 使用py ...
- Python学习 day04打卡
今天学习的主要内容: 一,列表 1,列表的介绍 列表是python的基础数据类型之一,其他编程语音也有类似的数据类型.例如:JS 中的数组Java中的数组等等. 它是以[]括起来,每个元素用',隔开而 ...
- python 下载地址
https://www.python.org/ftp/python/
- 《剑指offer》第五十三题(0到n-1中缺失的数字)
// 面试题53(二):0到n-1中缺失的数字 // 题目:一个长度为n-1的递增排序数组中的所有数字都是唯一的,并且每个数字 // 都在范围0到n-1之内.在范围0到n-1的n个数字中有且只有一个数 ...
- RestTemplate学习
在学习spring cloud的时候,用到了RestTemplate,找到一篇博客,写的很好,学习转载! 文章转载自:https://blog.csdn.net/itguangit/article/d ...
- Codeforces 1071 C - Triple Flips
C - Triple Flips 思路: 小范围暴力 大范围递归构造 构造方法: solve(l, r) 表示使l 到 r 区间全变为0的方法 为了使反转次数小于等于n/3 + 12 我们只需要保证每 ...
- Codeforces 920F - SUM and REPLACE
920F - SUM and REPLACE 思路1: 线段树(982 ms) 每个点最多更新6次 代码: #include<bits/stdc++.h> using namespace ...
- winfrom datagridview ,picturebox,显示图片,以及删除问题
private void write_listview(DataSet ds) { DataTable dt = ds.Tables[0]; ...
- 网格视图GridView的使用
网格视图GridView的排列方式与矩阵类似,当屏幕上有很多元素(文字.图片或其他元素)需要按矩阵格式进行显示时,就可以使用GridView控件来实现. 本文将以一个具体的实例来说明如何使用GridV ...