jinchengde 发表于 2012-8-23 17:40:39

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

本帖最后由 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
[*] CMake GUI
[*] Microsoft Visual Studio 2010 Express
[*] msysGit
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 http://wiki.flightgear.org/images/c/c7/CMake_GUI_Configure.png. 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 http://wiki.flightgear.org/images/c/c7/CMake_GUI_Configure.png again.
[*] Set theCMAKE_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 http://wiki.flightgear.org/images/5/5d/CMake_GUI_Generate.png is enabled.
[*] Press http://wiki.flightgear.org/images/5/5d/CMake_GUI_Generate.png.
[*] 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" toolbarhttp://wiki.flightgear.org/images/1/18/MVSC_2010_solution.png
[*] 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, http://wiki.flightgear.org/images/c/c7/CMake_GUI_Configure.png and http://wiki.flightgear.org/images/5/5d/CMake_GUI_Generate.png.
[*] 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!

liuwh_99 发表于 2012-8-24 00:12:16

有人编译Debug版本吗?运行时报错!

jinchengde 发表于 2012-8-24 11:54:55

liuwh_99 发表于 2012-8-24 00:12 static/image/common/back.gif
有人编译Debug版本吗?运行时报错!

报什么错?

liuwh_99 发表于 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版代码,问题一样!!!

liuwh_99 发表于 2012-8-25 23:54:36

V2.9(2.8问题也一样),Debug状态下运行,起飞后,在menu选择Position on the ground, 报错:

jinchengde 发表于 2012-8-27 00:12:43

liuwh_99 发表于 2012-8-25 23:54 static/image/common/back.gif
V2.9(2.8问题也一样),Debug状态下运行,起飞后,在menu选择Position on the ground, 报错:

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

freeyun 发表于 2012-9-24 20:19:58

liuwh_99 发表于 2012-8-25 22:57 static/image/common/back.gif
一个是_CrtIsValidHeap错误,由于Atmosphere.cxx和StandardAtmosphere.cxx中“P-sl-psf”属性的Tie操作造成 ...

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

天天 发表于 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
非常着急请大家帮帮我谢谢了   

freeyun 发表于 2013-3-16 21:29:31

天天 发表于 2012-12-11 01:11 static/image/common/back.gif
在用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目录

chiuras 发表于 2013-5-23 22:20:45

怎么设置BOOST_ROOT?要在PATH里面设置?
页: [1] 2
查看完整版本: 【转】Visual C++ 2010编译FlightGear 2.8.0