QQ登录

只需一步,快速开始

楼主: jinchengde
打印 上一主题 下一主题

【转】Visual C++ 2010编译FlightGear 2.8.0

[复制链接]

主题

好友

450

积分

版主

跳转到指定楼层
楼主
发表于 2012-8-23 17:40:39 |显示全部楼层 |倒序浏览
本帖最后由 jinchengde 于 2012-8-23 17:46 编辑

引用:
http://wiki.flightgear.org/Building_using_CMake_-_Windows

第三方库下载:
ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/MSVC/



Required software   Directory tree On Windows, assumptions on the directory structure are made to automate the discovery of dependencies.
This recommended directory structure is described below. Clicking the links allows you to download pre-built parts (for 3rdParty, make sure to download the right bits version. You need only one of the zips.).

${MSVC_3RDPARTY_ROOT} /
       3rdParty /  
       ( includes boost, plib, fltk, zlib, libpng, libjpeg, libtiff, freetype, libsvn, gdal, ... )  
               bin /
               include /
               lib /
       boost_1_44_0 /  (included in the 3rdParty package linked above)  
               boost /
       install /
              msvc100 /
             ( for VS2010 32 bits, or msvc90, msvc90-64 or msvc100-64 for VS2008 32, VS2008 64 and VS2010 64 )  
                  OpenSceneGraph /  
                 ( OSG CMake install )  
                         bin /
                         include /
                         lib /
                  SimGear /  
                  (create this empty for now, subfolders will be created by build process)  
                        include /
                        lib /
                   FlightGear /  
                  (create this empty for now)  
                         include /
                         lib /
  When building a 64 bits version, use the following structure for the 3dparty tools:
               3rdParty.x64 /  ( 64 bit version )  
                        bin /
                        include /
                        lib /
  If you do not use the recommended structure you will need to enter paths by hand. Source and build directories can be located anywhere.
NdT: glut is missing for the 64bits build, you can use freeglut.
  Building
  • Set up a work directory as described above.
  • Building SimGear
    • Open the CMake gui.
    • Set "Where is the source code" to wherever you put the SimGear sources (from the released tarball or the git repository).
    • Set "Where to build the binaries" to a new empty directory (could be anywhere and any name, for example naming it simgear-build, at the same folder location as your unzipped SimGear source folder was put).
    • Press . The first time that the project is configured, CMake will bring up a window asking you to "Specify the generator for this project" i.e. which compiler you wish to use. Select Visual Studio 10, (or Visual Studio 10 Win64 for 64 bit), and press Finish. CMake will now do a check on your system and will produce a preliminary build configuration.
    • CMake adds new configuration variables in red. Some have a value ending with -NOTFOUND. These variables should receive your attention. Some errors will prevent SimGear from building and others will simply invalidate some options without causing build errors.
      • First check the MSVC_3RDPARTY_ROOT variable. If it is not set, chances are that there will be a lot of -NOTFOUND errors. Instead of trying to fix every error individually, set that variable to the location of the directory structure that is presented above. Then press again.
      • Set the  CMAKE_INSTALL_PREFIX variable to ${MSVC_3RDPARTY_ROOT}/install/msvc100/SimGear.
      • Also check the lines with a checkbox. These are build options and may impact the feature set of the built program.
    • Repeat the process from step 5, until is enabled.
    • Press .
    • Start Visual Studio 2010 and load the SimGear solution (SimGear.sln) located in "Where to build the binaries".
    • Choose the "Release" build in the VS2010 "Generation" toolbar
    • Generate the solution with F7 key or right-click the top level "Solution SimGear" in the Solution Explorer and choose Build.
    • If there are build errors, return to CMake, clear remaining errors, and .
    • When Visual Studio is able to build everything without errors, right-click on the INSTALL project (further down within the "Solution Simgear" solution) and choose Build, which will put the include and lib files in ${CMAKE_INSTALL_PREFIX}
  • Building FlightGear Repeat the steps under Building Simgear, but change the SimGear paths to FlightGear.
  • Enjoy!
分享到: QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
分享分享0 收藏收藏1

主题

好友

450

积分

版主

沙发
发表于 2012-8-24 11:54:55 |显示全部楼层
liuwh_99 发表于 2012-8-24 00:12
有人编译Debug版本吗?运行时报错!

报什么错?
回复

使用道具 举报

主题

好友

450

积分

版主

板凳
发表于 2012-8-27 00:12:43 |显示全部楼层
liuwh_99 发表于 2012-8-25 23:54
V2.9(2.8问题也一样),Debug状态下运行,起飞后,在menu选择Position on the ground, 报错:

貌似是某个析构函数挂掉了,没遇到过这个问题,所以我也不知道。
可以到新闻组发个贴问问去,那儿大牛比较多。
回复

使用道具 举报

主题

好友

450

积分

版主

地板
发表于 2013-6-6 21:56:03 |显示全部楼层
chiuras 发表于 2013-5-23 22:20
怎么设置BOOST_ROOT?要在PATH里面设置?

不需要再PATH里面设置吧,我似乎没有设置BOOST_ROOT也可以
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 加入FG

本版积分规则

手机版|联系我们| FlightGear ( 吉ICP备19002044号-7 )

GMT+8, 2024-5-19 20:01

Powered by Discuz! X3.2

© 2001-2013 FlightGear Inc.

返回顶部