OSG Win7 + VS2015 编译

1. 准备

建立目标树

OpenSceneGraph-VERSION (VERSION替换为版本号)
OpenSceneGraph-VERSION\3rdParty (把依赖库放在此目录)

http://www.openscenegraph.org/index.php/download-section/dependencies
OpenSceneGraph-VERSION\OpenSceneGraph(源代码放在此目录)

2. 三方依赖库构建

  1. https://github.com/bjornblissing/osg-3rdparty-cmake下载CMake脚本(Download the CMake scripts from this repository).
  2. 下载依赖库源文件. Download the source for the dependencies you would like to use from their respective location as specified below.
  3. 打开CMake GUI, 选择CMake脚本所在目录, 指定生成库输出目录. Start the CMake GUI and select the directory with the CMake scripts as your source directory. Use any desired output directory as binary directory.
  4. 在CMake GUI中按"Configure". Press Configure inside the CMake GUI.
  5. 填写依赖库源代码目录, 再按"Configure". 重复配置, 直到没有错误和警告为止. Fill in the location of the downloaded sources of your desired dependencies and press "Configure" again. Repeat until there is no more errors and warnings in CMake.
  6. Generate 在输出目录中生成VS解决方案文件. Press Generate inside the CMake GUI. This will generate solution file inside your binary directory.
  7. 在VS IDE中打开解决方案文件. Open the solution file in your IDE.
  8. 编译ALL_BUILD项目. Build the ALL_BUILD project for both debug and release.
  9. 编译INSTALL项目. Build the INSTALL project for both debug and release.

In your binary directory there will now be a folder named 3rdParty with a sub-folder named after your target platform. Inside this folder there should be all your headers and libraries.

3. 构建OpenSceneGraph解决方案

在CMake GUI中选择OpenSceneGraph 源文件目录, 设置CMake配置输出目录.

ACTUAL_3RDPARTY_DIR  3rdParty编译库集目录

CMAKE_INSTALL_PREFIX  OpenSceneGraph 编译成果安装目录

BUILD_OSG_EXAMPLES     是否编译示例

Once the sources and dependencies are in place you need to generate the Visual Studio solution and project files. This is done with CMake. Download it at http://www.cmake.org/HTML/Download.html.

Start the CMake GUI once it‘s installed, and select root OpenSceneGraph directory in the "Where is the source code" field. The same directory needs to be put into the "Where to build the binaries" field. If you like to do out-of-source builds, you can add \build to the end. Then click Configure.

You can then customize your build. The red lines in the CMake window indicate new variables that you may want to fill out or change, but most are optional. Some variables will be filled in automatically (such as ACTUAL_3RDPARTY_DIR, if you followed the directory structure above). I typically enable BUILD_OSG_EXAMPLES and set CMAKE_INSTALL_PREFIX to the OpenSceneGraph directory so that the binaries are installed in OpenSceneGraph\bin. You can also set it to somewhere else if you want to keep your source tree clean.

4. OpenSceneGraph编译

打开OpenSceneGraph解决方案进行编译

  1. 编译ALL_BUILD项目. Build the ALL_BUILD project for both debug and release.
  2. 编译INSTALL项目. Build the INSTALL project for both debug and release.
时间: 2024-10-17 07:51:19

OSG Win7 + VS2015 编译的相关文章

趟坑:WIN7 + VS2015 编译 阿里MNN框架

用过腾讯的ncnn,编译起来很友好:但是对3d操作算子支持不够:导致新出现的模型无法使用. 看到阿里开发的mnn,来尝尝鲜,结果断续折腾了2天,以此记之. 非常感谢: https://uzshare.com/view/810473 https://www.yuque.com/mnn/cn/build_windows 里面详细介绍了一些配置操作. 1.设置 2.将powershell ./schema/generate.ps1换成python ./schema/generate.py 如果要编译x

Win7 VS2015编译wxWidgets-3.1.0

下载 https://www.wxwidgets.org/downloads/ 打开SLN工程 D:\CPPLibs\wxWidgets-3.1.0\build\msw\wx_vc14.sln 编译 DLL Debug DLL Release 新建空Win32项目 创建一个空的main.cpp文件到工程 工程属性里加入include目录 D:\CPPLibs\wxWidgets-3.1.0\include D:\CPPLibs\wxWidgets-3.1.0\include\msvc 及Lib目

win7下编译安装osgearth

文章摘要:本文记录了在win7下,通过源码,编译,安装osgearth的全部过程.环境说明:vs2010/cmake3.01/openscenegraph3.2/osgearth2.5 一.下载源码 下载源码包 https://github.com/gwaldron/osgearth/zipball/osgearth-2.5 通过git下载 git clone https://github.com/gwaldron/osgearth.git (下载的是最新版) 二.环境准备 安装依赖库opens

使用VS2015 编译 64位的boost库

别人写的编译参考: 目标:使用VS2015 编译 64位的boost库. 一直以来都是在Win32环境下Build和使用boost,但现在基本上每天都在64位Win7下工作,所以很有必要把这几天的经验总结下来. 1. 下载并解压boost 1.61.0 压缩包 2. 解压并运行批处理文件bootstrap.bat,目录下会生成两个可执行文件 3. 和32位环境不同,x64环境下编译得先从开始菜单启动Visual Studio的VS2015 x64 Native Tools Command Pro

Win10下vs2015编译OSGEarth2.10

一.OSG编译 1. 源码或预编译库下载 OSG版本3.6.3:CMake版本3.12.1-x64:Geos版本:3.7.1:GDAL版本:2.3.1:数据包由官网下载:官网上还提供其他vs2015环境下OSG编译依赖的第三方库所用的CMake编译脚本,其地址为https://github.com/bjornblissing/osg-3rdparty-cmake同时该页面提供由AppVeyor所预编译好的vs2015和vs2017的库文件下载. 2. 文件目录 D:\OSG\OpenSceneG

QT5.6.0+VS2015编译MQSQL(ACCESS)X64数据库驱动

QT5.6.0+VS2015编译MQSQL(ACCESS)数据库驱动 1 说明 l 不建议QT5.6.0使用ACCESS数据库.如果想使用轻量级的数据库,可以使用Sqlite数据库. QT想要访问Access.SQL Server等数据库可以通过ODBC的方式来访问,但是QT较高版本已不提供ODBC驱动库,需要自己编译.QT5.6.0编译出来的数据库驱动是64位,但是不建议安装Access数据库,微软本身也不建议安装64位office. PS:为什么QT5.6.0不编译32位数据库驱动:编译数据

在win7 下编译MySQL源码

MySQL MySQL是一款优秀的开源数据库,在阿里.网易等各个互联网公司中有着广泛的应用.尽管各种NoSQL大行其道,但是关系型数据库依然必不可少. 作为一个新手,在Win7下用源码安装MySql数据库并不容易.我自己都折腾了好几天.今天把安装过程记录下来,其一是为了方便自己以后学习,其二则是分享过程,让学习者能够从我这篇文章中受益. 1. 编译环境及源码下载 编译环境:Visual Studio 2010 (Win7 32位) 编译工具: bison-2.4.1-setup.exe 下载地址

OSG+QT5+vs2010编译

OSG+QT5+vs2010编译 作者:[email protected]  本文属于原创,转载请注明出处. 由于网上没有找到关于编译QT5环境下的OSG,自己就研究了下,记录下整个过程,希望能帮到大家. 1. 准备工作 下载源代码: A.openscenegraph 3.2.1(当前最新的realease版本) http://www.openscenegraph.org/downloads/developer_releases/OpenSceneGraph-3.2.1.zip B.osg-3r

vs2015编译ffmpeg 出现错误rtmp.lib(rtmp.obj) : error LNK2001: 无法解析的外部符号 ___iob_func

vs2015编译ffmpeg(版本3.0.2)引用外部库文件librtmp出现以下错误: rtmp.lib(rtmp.obj) : error LNK2001: 无法解析的外部符号 __imp__strtod rtmp.lib(rtmp.obj) : error LNK2001: 无法解析的外部符号 __imp__sscanf rtmp.lib(rtmp.obj) : error LNK2001: 无法解析的外部符号 __imp___snprintf rtmp.lib(rtmp.obj) : e