QQ登录

只需一步,快速开始

查看: 13569|回复: 15
打印 上一主题 下一主题

【转】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

主题

好友

47

积分

报考学院待录取

沙发
发表于 2012-8-24 00:12:16 |只看该作者
有人编译Debug版本吗?运行时报错!

点评

报什么错?  详情 回复 发表于 2012-8-24 11:54
回复

使用道具 举报

主题

好友

450

积分

版主

板凳
发表于 2012-8-24 11:54:55 |只看该作者
liuwh_99 发表于 2012-8-24 00:12
有人编译Debug版本吗?运行时报错!

报什么错?
回复

使用道具 举报

主题

好友

47

积分

报考学院待录取

地板
发表于 2012-8-25 22:57:32 |只看该作者
一个是_CrtIsValidHeap错误,由于Atmosphere.cxx和StandardAtmosphere.cxx中“P-sl-psf”属性的Tie操作造成;另一个是HttpClient类造成的,调用堆栈显示程序停在simgear的网络操作函数中,我直接屏蔽了相关的内容,能够运行了,但重新设置位置时void fgReInitSubsystems()中    globals->restoreInitialState();处报错,还没有查出原因。 另外从菜单调出对话框,修改参数,也肯定报错,调用堆栈显示停在simgear的gui相关的函数。
我用GIT下载了2.9版代码,问题一样!!!
回复

使用道具 举报

主题

好友

47

积分

报考学院待录取

5#
发表于 2012-8-25 23:54:36 |只看该作者
V2.9(2.8问题也一样),Debug状态下运行,起飞后,在menu选择Position on the ground, 报错:

捕获.PNG (16.91 KB, 下载次数: 613)

捕获.PNG

捕获1.PNG (41 KB, 下载次数: 669)

捕获1.PNG

点评

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

使用道具 举报

主题

好友

450

积分

版主

6#
发表于 2012-8-27 00:12:43 |只看该作者
liuwh_99 发表于 2012-8-25 23:54
V2.9(2.8问题也一样),Debug状态下运行,起飞后,在menu选择Position on the ground, 报错:

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

使用道具 举报

主题

好友

565

积分

超级版主

7#
发表于 2012-9-24 20:19:58 |只看该作者
liuwh_99 发表于 2012-8-25 22:57
一个是_CrtIsValidHeap错误,由于Atmosphere.cxx和StandardAtmosphere.cxx中“P-sl-psf”属性的Tie操作造成 ...

另一个是HttpClient类,你把实时天气关闭就不会了,暂时解决方法
回复

使用道具 举报

主题

好友

47

积分

报考学院待录取

8#
发表于 2012-12-11 01:11:13 |只看该作者
在用cmake编译simgear的时候出现了错误
CMake Error at F:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:1192 (message):
  Unable to find the requested Boost libraries.
  Unable to find the Boost header files.  Please set BOOST_ROOT to the root
  directory containing Boost or BOOST_INCLUDEDIR to the directory containing
  Boost's headers.
Call Stack (most recent call first):
  CMakeLists.txt:110 (find_package)
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Boost_INCLUDE_DIR (ADVANCED)
   used as include directory in directory C:/FlightGear/simgear-2.8.0
非常着急  请大家帮帮我  谢谢了   

点评

Please set BOOST_ROOT to the root 没有找到boost头文件 ,叫你设置boost目录  详情 回复 发表于 2013-3-16 21:29
回复

使用道具 举报

主题

好友

565

积分

超级版主

9#
发表于 2013-3-16 21:29:31 |只看该作者
天天 发表于 2012-12-11 01:11
在用cmake编译simgear的时候出现了错误
CMake Error at F:/Program Files/CMake 2.8/share/cmake-2.8/Modu ...

Please set BOOST_ROOT to the root 没有找到boost头文件 ,叫你设置boost目录
回复

使用道具 举报

主题

好友

67

积分

航院新生

10#
发表于 2013-5-23 22:20:45 |只看该作者
怎么设置BOOST_ROOT?要在PATH里面设置?

点评

不需要再PATH里面设置吧,我似乎没有设置BOOST_ROOT也可以  详情 回复 发表于 2013-6-6 21:56
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-7 11:12

Powered by Discuz! X3.2

© 2001-2013 FlightGear Inc.

返回顶部