日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 运维知识 > windows >内容正文

windows

【Ogre-windows】环境配置

發(fā)布時(shí)間:2023/12/13 windows 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【Ogre-windows】环境配置 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

前言

由于工程原因, 學(xué)習(xí)一下Ogre面向?qū)ο髨D形渲染開源引擎, 慢慢爬坑吧。首先還是環(huán)境的配置問題哎. 其實(shí)最重要的是要預(yù)先編譯三方庫(kù), 雖然官方說可以自動(dòng)編譯, 但是在自己電腦上還是出現(xiàn)了無法解析外部符號(hào)之類的問題, 正常情況下我就認(rèn)為是三方庫(kù)的lib出現(xiàn)了問題, 最后額外編譯三方庫(kù)才得到了解決, 話不多說, 安裝開始.

環(huán)境: windows10、VS2013、Ogre1.10

所需code:

官方網(wǎng)址: Ogre1.10(github)、三方庫(kù) 、SDL2 、boost

【注】boost最好下載電腦所對(duì)應(yīng)的VS版本, 我的電腦是VS2013, 所以下載boost_1_61_0-msvc-12.0-64.exe

百度網(wǎng)盤:

Ogre: 鏈接: https://pan.baidu.com/s/1TIPy-rndd-uBZJZynkvzrw 密碼: uf5c

三方庫(kù): 鏈接:http://pan.baidu.com/s/1c1XCh0W 密碼:db29

SDL2: 鏈接:http://pan.baidu.com/s/1qXAnaA4 密碼:hegq

BOOST: 鏈接:http://pan.baidu.com/s/1pLMG7px 密碼:q8a8

國(guó)際慣例, 參考博客:

OGRE 2.1 Windows 編譯

官方manual

安裝

三方庫(kù)配置

  • 先安裝boost, 一直下一步就行了, 我安裝的位置是D:\Package\boost_1_61_0, 注意設(shè)置一下環(huán)境變量

    再看看我安裝后的目錄有哪些文件

  • 新建一個(gè)文件夾Ogre1.10放置三方庫(kù)以及后續(xù)的編譯好的程序, 將三方庫(kù)解壓進(jìn)來, 并在D:\Package\Ogre1.10\cabalistic-ogredeps-a337c4874a15\src新建文件夾SDL2, 將下載的SDL2壓縮包中的大約40個(gè)文件復(fù)制丟進(jìn)來, 并在D:\Package\Ogre1.10\cabalistic-ogredeps-a337c4874a15新建一個(gè)build文件夾, 接下來打開cmake-GUI, 設(shè)置好相關(guān)路徑

    直接點(diǎn)擊Configure, 截圖一下我的結(jié)果





    調(diào)試日志如下:

    The C compiler identification is MSVC 18.0.40629.0 The CXX compiler identification is MSVC 18.0.40629.0 Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe -- works Detecting C compiler ABI info Detecting C compiler ABI info - done Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe -- works Detecting CXX compiler ABI info Detecting CXX compiler ABI info - done Detecting CXX compile features Detecting CXX compile features - done Looking for DirectX... DirectX_PREFIX_PATH changed. Check size of void* Check size of void* - done Found DirectX: C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x86/d3d9.lib DX lib dir: C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x86 DX lib dir: C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x86 Check size of void* Check size of void* - done Configuring done

    雖然全是紅色的, 但是再Configure一下就沒了, 如果還有紅色的, 那你就得好好核對(duì)一下我上面貼的一堆圖了. 隨后Generate一下, 就看到build文件夾下已經(jīng)有完整的VS工程啦

    然后打開OGREDEPS.sln, 對(duì)ALL_BUILD生成一次, 就發(fā)生問題了

    錯(cuò)誤 944 error MSB6006: “cmd.exe”已退出,代碼為 1。 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets 170 5 SDL2

    這時(shí)候就考察VS的調(diào)試功底了, 直接去輸出窗口看具體位置:

    5> Move SDL2 install files into the Release and Debug folders. 5> CMake Error at D:/Package/Ogre1.10/cabalistic-ogredeps-a337c4874a15/build/src/SDL2-prefix/src/SDL2-stamp/SDL2-MoveInstallFiles-Debug.cmake:16 (message): 5> Command failed: 1 5> 5> 'C:/Program Files/CMake/bin/cmake.exe' '-Dmake=' '-Dconfig=Debug' '-P' 'D:/Package/Ogre1.10/cabalistic-ogredeps-a337c4874a15/build/src/SDL2-prefix/src/SDL2-stamp/SDL2-MoveInstallFiles-Debug-impl.cmake' 5> 5> See also 5> 5> D:/Package/Ogre1.10/cabalistic-ogredeps-a337c4874a15/build/src/SDL2-prefix/src/SDL2-stamp/SDL2-MoveInstallFiles-*.log 5> 5> 5>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(170,5): error MSB6006: “cmd.exe”已退出,代碼為 1

    很清晰地發(fā)現(xiàn)錯(cuò)誤日志已經(jīng)被丟到SDL2-MoveInstallFiles-*.log中, 去瞅一眼

    Error copying file "bin/SDL2.dll" to "bin/Debug/SDL2.dll". CMake Error at D:/Package/Ogre1.10/cabalistic-ogredeps-a337c4874a15/build/src/SDL2-prefix/src/SDL2-stamp/SDL2-MoveInstallFiles-Debug-impl.cmake:29 (message): Command failed (1):'C:/Program Files/CMake/bin/cmake.exe' '-E' 'copy' 'bin/SDL2.dll' 'bin/Debug/SDL2.dll'

    很多人看到這類英文錯(cuò)誤就直接問人, 小兄弟啊, 遇到錯(cuò)誤先認(rèn)真看一遍, 至少先翻譯一下也行啊. 嗯, 閑話不多說, 這個(gè)問題就是復(fù)制SDL2.dll的時(shí)候出問題了, 三方庫(kù)的輸出目錄是D:\Package\Ogre1.10\cabalistic-ogredeps-a337c4874a15\build\ogredeps, 可以發(fā)現(xiàn)在bin下的確有SDL2d.dll躺著, 主要是由于我們編譯的是Debug模式. 所以沒找到SDL2.dll, 導(dǎo)致錯(cuò)誤, 解決方法很簡(jiǎn)單, 切換Release模式重新編譯, 或者手動(dòng)把這個(gè)文件拷貝進(jìn)去.建議兩個(gè)都做一遍, 反正不沖突.

  • 最后對(duì)INSTALL生成一遍,一定要核對(duì)一下相關(guān)文件(VS工程中出現(xiàn)的那幾個(gè)三方庫(kù))是否在ogredeps文件中, 主要有
    include: 相關(guān)頭文件, 這個(gè)一般都存在
    lib: 相關(guān)lib庫(kù)文件
    bin: 相關(guān)dll庫(kù)文件
    如果不在, 直接針對(duì)每個(gè)項(xiàng)目右鍵打開文件資源管理器, 找到以后復(fù)制過來.

編譯Ogre源程序

  • 將ogre-master解壓到D:\Package\Ogre1.10中, 然后將剛才編譯的三方庫(kù)ogredeps放入到ogre-master中, 并更名為Dependencies, 在D:\Package\Ogre1.10下新建文件夾Ogre用于存儲(chǔ)編譯的Ogre, 在cmake-gui中設(shè)置路徑

    然后Configure, 調(diào)試信息太多了, 就不貼了, 第二次Configure出現(xiàn)錯(cuò)誤

    send_errorD:/Package/Ogre1.10/Ogre/Dependencies/bin/debug/cg.dll did not exist, can't install! send_errorD:/Package/Ogre1.10/Ogre/Dependencies/bin/release/cg.dll did not exist, can't install!

    這個(gè)文件在剛才編譯三方庫(kù)的時(shí)候D:\Package\Ogre1.10\cabalistic-ogredeps-a337c4874a15\build\bin里面, 同時(shí)我們還發(fā)現(xiàn)另外兩個(gè)dll: OIS.dll和Remotery.dll, 保險(xiǎn)起見都復(fù)制過去吧,兩種模式Debug和Release, 重新Configure就沒問題了, 調(diào)試日志如下

Configuring OGRE 1.10.10Search path: D:/Package/Ogre1.10/Ogre/Dependencies;D:/Package/Ogre1.10/ogre-master/Dependencies;D:/Package/Ogre1.10/Ogre/../Dependencies;D:/Package/Ogre1.10/ogre-master/../DependenciesLooking for ZZip...Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) Found ZZip: optimized;D:/Package/Ogre1.10/ogre-master/Dependencies/lib/Release/zziplib.lib;debug;D:/Package/Ogre1.10/ogre-master/Dependencies/lib/Debug/zziplib_d.libLooking for FreeImage...Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) Found FreeImage: optimized;D:/Package/Ogre1.10/ogre-master/Dependencies/lib/Release/FreeImage.lib;debug;D:/Package/Ogre1.10/ogre-master/Dependencies/lib/Debug/FreeImage_d.libLooking for FREETYPE...Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) CMAKE_PREFIX_PATH: D:/Package/Ogre1.10/Ogre/Dependencies;D:/Package/Ogre1.10/ogre-master/Dependencies;D:/Package/Ogre1.10/Ogre/../Dependencies;D:/Package/Ogre1.10/ogre-master/../DependenciesCMAKE_PREFIX_PATH: D:/Package/Ogre1.10/Ogre/Dependencies;D:/Package/Ogre1.10/ogre-master/Dependencies;D:/Package/Ogre1.10/Ogre/../Dependencies;D:/Package/Ogre1.10/ogre-master/../DependenciesFound FREETYPE: optimized;D:/Package/Ogre1.10/Ogre/Dependencies/lib/freetype.lib;debug;D:/Package/Ogre1.10/ogre-master/Dependencies/lib/Debug/freetype_d.libLooking for DirectX9...Found DirectX9: D:/Package/Microsoft DirectX SDK (June 2010)/Lib/x86/d3d9.libLooking for DirectX11...Found DirectX11: d3d11.lib;dxgi.lib;dxguid.libLooking for Cg...Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) Found Cg: D:/Package/Ogre1.10/ogre-master/Dependencies/lib/Release/cg.libLooking for POCO...Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) Could not locate POCOLooking for TBB...Could not locate TBBLooking for GLSL_Optimizer...Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) Could not locate GLSL_OptimizerLooking for HLSL2GLSL...Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) Could not locate HLSL2GLSLCould NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) Looking for Softimage...Could not locate Softimage------------------------------------------------------------------------------- The following external packages were located on your system.-- This installation will have the extra features provided by these packages.+ zlib+ zziplib+ freeimage+ freetype+ OpenGL+ OpenGL 3++ OpenGL ES 1.x+ OpenGL ES 2.x+ OpenGL ES 3.x+ DirectX9+ DirectX11+ cg+ Python+ SDL2------------------------------------------------------------------------------- The following OPTIONAL packages could NOT be located on your system.-- Consider installing them to enable more features from this software.+ boost: Boost (general) <http://boost.org>+ boost-thread: Used for threading support <http://boost.org>+ POCO: POCO framework <http://pocoproject.org/>+ tbb: Threading Building Blocks <http://www.threadingbuildingblocks.org/>+ GLSL Optimizer: GLSL Optimizer <http://github.com/aras-p/glsl-optimizer/>+ HLSL2GLSL: HLSL2GLSL <http://hlsl2glslfork.googlecode.com/>+ OpenEXR: Load High dynamic range images <http://www.openexr.com/>+ Doxygen: Tool for building API documentation <http://doxygen.org>+ Softimage: Softimage SDK needed for building XSIExporter <FALSE>-----------------------------------------------------------------------------Could NOT find SWIG (missing: SWIG_EXECUTABLE SWIG_DIR) Could NOT find SWIG (missing: SWIG_EXECUTABLE SWIG_DIR) ----------------------------------------------------------------------------FEATURE SUMMARY----------------------------------------------------------------------------Building components:+ Bites [BETA]+ HLMS [BETA]+ MeshLodGenerator+ Overlay+ Paging+ Property [DEPRECATED]+ Python [BETA]+ Java/ JNI [BETA]+ RTShader System+ RTShader System Core Shaders+ RTShader System Extensions Shaders+ Terrain+ VolumeBuilding plugins:+ BSP scene manager+ Cg program manager+ Octree scene manager+ Portal connected zone scene manager+ Particle FXBuilding rendersystems:+ Direct3D 9+ Direct3D 11+ OpenGL+ OpenGL 3+Building executables:+ Samples+ ToolsBuilding core features:+ Mesh Lod+ DDS image codec (.dds)+ ETC image codec (.pkm, .ktx) + FreeImage codec (generic)+ ZIP archivesBuild type: sharedUse C++11 std library: OFFStore child nodes as: map [DEPRECATED]Thread safety: noneResourceManager behaviour: legacy [DEPRECATED]Use double precision: disabledNodes inherit transform: disabledAssert mode: release exceptionsAllocator type: standardSTL containers use allocator: disabledStrings use allocator: disabledMemory tracker (debug): disabledMemory tracker (release): disabled----------------------------------------------------------------------------Configuring doneGenerating done

Generate一下, 生成VS2013的工程文件, 可以在D:\Package\Ogre1.10\Ogre中找到.
【注】上述過程也可以在Cmake-GUI中不勾選OGRE_BUILD_DEPENDENCIES,并且設(shè)置OGRE_DEPENDENCIES_DIR為你的三方庫(kù)目錄, 好像更快一些
- 編譯OGRE.sln, 先ALL_BUILD一下, 時(shí)間挺久的, 要盯著錯(cuò)誤列表, 一旦出現(xiàn)錯(cuò)誤, 就直接取消生成解決錯(cuò)誤吧. 個(gè)人覺得很多人會(huì)出現(xiàn)外部符號(hào)無法解析問題, 一定是由于lib文件沒折騰好引起的. 重新仔細(xì)核對(duì)上述步驟, 尤其是核對(duì)dll和lib是否折騰對(duì).
【注】這里貼一下我編譯好的三方庫(kù),便于大家核對(duì) :鏈接:http://pan.baidu.com/s/1boDvokv 密碼:lkap
然后就可以INSTALL啦, 這個(gè)就是生成我們后續(xù)開發(fā)需要引用的Ogre各種文件, 存在于D:\Package\Ogre1.10\Ogre\sdk目錄下, 以后開發(fā)就只需要它應(yīng)該就可以了.

  • 最后可以通過VS運(yùn)行程序, 也可以通過D:\Package\Ogre1.10\Ogre\bin\debug\SampleBrowser_d.exe運(yùn)行程序

總結(jié)

以上是生活随笔為你收集整理的【Ogre-windows】环境配置的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。