FlightGear OSG, boost, using MSVC

external: index
internal: preamble | boost | folders | build | downloads | PLIB | images | previous | OSG CMake | end
steps: [pre] [ 1] [ 2] [ 3] [ 4] [ 5] [ 6] [ 7] [ 8] [ 9] [10] [11] [12] [13] [14] [15] [flying]


2011-11-02: Minor update, adding images of the OSG CMake (see Step 9). My base directory: C:\FG\28.

2010-07-04: Version MSVC8-WIN32-2.0.2 - After some struggle to get the new 'git' repository sources settled, did a full 3rd party source update, including OpenSceneGraph, boost, et al, and did a build in XP with MSVC8 for a change. As usual, had a few files to delete, and a number to add to FG build files... and a new requirement for a boost static library, the FIRST ;=)) meant I had to get into boost-building for the first time. The batch file build of bjam.exe work AFTER I remove some brackets, ( ), from my PATH environment variable. And after that running bjam was a breeze...

2010-03-03: Version MSVC9-WIN32-2.0.2 - Another quick CVS update of SG, FG, FG DATA, yesterday, and recompile. One new file had to be added to FG project files - WaypointsList.[c|h]xx - and it was done.

2010-02-14: Version MSVC9-WIN32-2.0.1 - Just a quick update to FG version 2.0.1. I have given it this version number because this is a CVS update, including an update of OSG svn, post the recent FG 2.0.0 release. For me, with my  ATI Radeon HD 2600 XT, in Vista 32-bits, this is an important update, since the orange 'pall' problem seem FIXED ;=))

2010-01-17: Version MSVC9-WIN32-2.0.0-rc1 - Took some time to get there, but eventually... Have added a few more batch files, but these are mainly for 'working', and still get some dark/orange 'banding' on my ATI Radeon HD 2600 XT, but am sure this is the driver, since these 'bands' are not there in Ubuntu in the SAME machine. Did not update OSG this time, at SVN version 10764, which is about Version 2.9.6, due to the problems last time.

To make it clear, to build FG using my  TWO SOLUTION SYSTEM (TSS)  you ONLY need to establish the  SOURCE  directory structure, shown below, filled with the prerequisite sources, via CVS/SVN/tar.gz, as appropriate - see dependence page for links - such that you can run the SETUPFG.BAT file to CREATE a new WORK folder. SETUPFG.BAT pre-checks for all the sources it needs before running. It will tell you when you got it RIGHT ;=))

As usual, also included is the complete WIN32 runtime, with all the OSG DLLs (and sound DLLS) in fgvc9rt15.zip. This can be downloaded, and unzipped into a directory of your choice. Change into the 'bin' folder created, and run > FlightGear.exe --fg-root=<path/to/FG/data>, and you should be flying ;=)).

With this zip, the only additional download is the FG base data, say via GIT (was CVS), or otherwise, and then the only additional DLLs, not usually present, are the OpenAL (sound) DLLs, namely OpenAL32.dll, and wrap_oal.dll, which are available through the OpenAL SDK, and alut.dll, which you can build. These 3 sound DLLS are also in the OpenAL-11.zip, contained in the above runtime zip.

Have added one two(2) additional zips. One is 'just' the FlightGear.exe, fgvc9-exe-15.zip, if you already have _ALL_ the 3rd party, that is the OSG DLLs, and vc9-libs-15.zip with the 'development' libraries so you do not have to build all the 3rd party items, but you still need the sources, for the headers.

The previous update notes have been moved to the end of this page - see previous.


As of 2008/11/28, the CVS version of FlightGear (FG) added a NEW dependency, namely 'boost', so it seemed a good time to do another build using my own  TWO SOLUTION SYSTEM (TSS)  ;=)) What this means is that I have created a fgfs/fgfs.dsw file that handles some 14 projects, of the FlightGear solution, and OpenSceneGraph (OSG) is the only item compiled separately.

Because OSG requires zlib.lib and libpng.lib and their respective include, the FG solution should be used to build these two items first with MSVC; then onto OSG, beginning with CMake, then MSVC; then back to FG MSVC to complete the full solution ... this why I call it a 'TWO' solution system.

The dependency on 'boost' does not change much, but the 'boost' headers must be download, and 'installed' in the correct place in the WORK folder - see folders below ... Only the 'headers' are required at this time, so there is nothing to compile for 'boost'...


Boost Library

The 'boost' library, http://www.boost.org/, is now a dependant for FlightGear compile. Originally only the 'boost' headers were used, but now there is a dependency on at lease one static library, so maybe you could download a binary distribution, or compile everything in 'boost', once you have downloaded its source. There Boost.Jam v2 build system worked very well with MSVC8 - just do 'boostrap.bat', then 'bjam', and it should be done.

The 'boost' source can be downloaded either as a tar ball, or zipped file, or via SVN, getting the 'trunk' only.

Tar ball (zipped)

At this time (2010-07-04) 'boost' version 1.44 is available, while when this page started, (2008/11/28), 'boost' version 1.37.0 (2008-11-02 23:11) was available, but get later if available. You can download boost_1_39_0.zip, or z, tar.bz2, tar.gz depending on your preference, or LATER version...

The zip file is about 54MB, other compressed files are less, but on my relatively fast internet connection, with a transfer rate of around 700KB/sec, that only took a minute or so ... This zip contained some 26,247 file, or about 185MB ...

When unpacked, this will begin with a directory boost_1_39_0, or later, but you can move, or copy the 'boost' sub-folder to your FlightGear WORK folder, and no change would be required in the FlightGear.vcproj file, else, you have to adjust the 'Additional Include Directories' to where ever you put 'boost' ...


The command -

svn co http://svn.boost.org/svn/boost/trunk boost-trunk

will generate a 'boost-trunk' folder.

That takes about 15 minutes, or so, even on my relatively fast internet connection, downloading and creating some 70,000 files, about 320MB, but remember SVN 'duplicates' EVERY file in its .svn folders. But then this can be later easily updated.

But which ever download you do, the important thing is to move or copy the 'boost' folder to the root FlightGear WORK folder, unless you wan to MODIFY the DSP or VCPROJ file to suit a NEW location for this include ...

At this time 'boost' headers are included in at least, but may be in others :-
SimGear\simgear\structure\OSGUtils.hxx (included in FlightGear\src\Main\CameraGroup.cxx)

If you really want to be LAZY, I now do include the used 'boost' header in the boost-??.zip file, in the vc?sln??.zip file below, but this is MOST CERTAINLY NOT RECOMMENDED. It is better you do you own download/checkout of the full 'boost' system, some twenty six thousand files - which you will have to do anyway, if I have missed some header, or the headers used changes, or etc ...


Folder Structure:

The dependence on the boost headers has added another SOURCE, and WORK folder. To use my TSS system you only have to get the SOURCE folder exactly correct to allow you to run SETUPFG.BAT. It will check for the SOURCE folders, and advise of any problem it finds. You can choose any 'root' for this SOURCE, but if you choose other than C:\FGCVS, will have to change the 'root', in the line @set TEMP2=C:\FGCVS, near the top of SETUPFG.BAT, then the 'WORK' will be generated, as the batch file copies _ALL_ the sources :-

SOURCE >>>== 2010-01-17 ==>>> WORK
view of source folders, with boost =>> ======================== =>>
=>> SOURCE is copied to WORK =>>
=>> by the  SETUPFG.BAT batch file =>>
=>> This bat file CREATES the WORK =>>
=>> with some minor name and structure =>>
=>> changes, like 'S/FlightGear/data' to =>>
=>> just 'W/data', 'S/FlightGear/source' =>>
=>> to 'W/FlightGear', etc, but this is all =>>
=>> done by the SETUPFG.BAT file =>>
=>> ======================== =>>
view of work folders, with boost

Note, as of 2010-07-04, a '3rdparty' folder was added to WORK, to hold 'lib/lib_boost-<module-vers>.lib static libraries.

This, other and earlier versions of the folder set can be found on the - prerequisites - page, on the previous page - fgfs-045.htm - and several other places...



This is a build table, with approximate timings, and additional comments -


Update _ALL_ the SOURCE, using CVS or SVN, as appropriate ... a few sources are via a 'tarball' or zip only, and in my case it is more than just the FG sources, and now includes the big 27,000 file 'boost' source. See prereq.htm for source checkout details. In my case this in the SOURCE folder C:\FGCVS. I had not done this for a few weeks. Daily updates typically take only about 5-10 minutes.



Download vcNslnNN.zip and extract SETUPFG.BAT into root of WORK folder. In my case C:\FG or G:\FG, depending on the machine...



Adjust SETUPFG.BAT to the ROOT of the SOURCE folder. The default is C:\FGCVS or G:\FGCVS, and requires no adjustment if the current is used.



Run SETUPFG.BAT, giving the WORK folder to be created, will copy sources to a NEW work folder. (optionally including 'data'). Be aware this copies some 41K of files, about 1.8GB with 'data' included. In this case I used >setupfg NN, where 'NN' is a number...



Unzip the full vcNslnNN.zip into the new WORK folder, using folder name, and overwriting existing files. In this case C:\FG\NN



Unzip all vcNcfgNN.zip, preserving paths ...



Unzip vcNchgNN.zip, preserving paths. As advised, this should be periodically checked to ensure _ALL_ changes are still required. Alternatively, you could use this 'patch' file - chgdiffINN.patch (older: fgfs-047.patch.txt)



Unzip vcNdswNN.zip and optionally run delslnlist.bat to avoid MSVC dialog questions, and load fgfs/fgfs.dsw in MSVC and allow conversion.



Build just the libpng and zlib projects. I use Build -> Batch ... selecting both libpng, zlib, and I add alut, then [Build]



Run CMake (2.6+) on the <work>\NN\OpenSceneGraph folder; Check [x] Show Advanced Values; click [ Configure ], selecting the appropriate MSVC; set ZLIB include to <work>\NN\zlib-1.2.3, and ZLIB library to <work>\NN\zlib-1.2.3\zlib.lib; [Configure] again; set PNG include to <work>\NN\lpng, and PNG library to <work>\NN\lpng\libpng.lib; [Configure] again; then [OK] to build solution set.



Load another MSVC, and open <work>\NN\OpenSceneGraph.sln, select 'Release' and build some 70 projects ...



boost: Either unzip the boost-05.zip, or use the copyboost.bat, maybe fixing the source location, or create a boost folder, and copy or move the SVN or ZIP boost source to this folder. Then back to, or reload MSVC fgfs/fgfs.sln, switch to Release, and build 14 projects



Optionally, unzip rfgbatsNN.zip, with folders - these will be put in <work>\NN\bin\bats



In the MSVC command prompt, since it uses nmake - see Tools -> VS Command Prompt, run UPD.BAT. This may requires adjusting the variables TEMPOSGV, TEMPPIV, and sometimes TEMPOTV, but UPD.BAT will give advice on what it finds, very good advice if you have Perl installed and run able ...



Copy release alut.dll to $(SYSTEMROOT)\System32 folder, to join where the OpenAL32.dll, and wrap_oal.dll reside, if not done previously.



cd bin\bats, and try the rfgufo, first or any of the other batch files available ... The load of FG takes a few minutes ... note any output to the console ...



  TOTAL TIME TO FLIGHT : (approx.) 1:55

This  TWO SOLUTION SYSTEM (TSS)  build system has now been tried using MSVC9 (2008), MSVC8 (2005), and MSVC7.1 (2003). Unfortunately, the build fails using MSVC6 (1998) - too old! In each case the start is fgfs/fgfs.dsw, and allow MSVC to convert the files ...



*** As always, take care downloading and running executables from the web! ;=(( ***

Current downloads available, built with MSVC8 :-

fgvc9-exe-15.zip - contains just FlightGear.exe, if you already have all the OSG (63) 2.9.7 DLLs.
fgvc9rt15.zip - contains FlightGear.exe, and the many OSG DLL needed to run FG executable.
vc9sln15.zip - contains SETUPFG.BAT, the initial setup batch, vc9cfg??.zip, vc9chg??.zip, vc6dsw??.zip, boost-??.zip, rfgbats??.zip, vc9PLIB-??.zip, and various other files...
vc9-libs-15.zip - contains the 3rd party 'static' and DLL libraries, for linking.
And is becoming my habit, the full source zips are also available, although the FG data zip only contains a small number of aircraft. It is always better you download the latest from the relevant repositories.

Date Zip Size MD5
04/07/2010 fgvc9-exe-15.zip 2,016,519 35bf11efc18378b826a2d39d204e168c
04/07/2010 fgvc9rt15.zip 6,802,609 33a61985bb7ccfe787871014d856b4ff
04/07/2010 vc9sln15.zip 1,115,046 ea2d0d8e47fd99718d0fa3462c2943e3
03/07/2010 vc9-libs-15.zip 7,399,986 b809a4b3aa048d39c483b140621a152d
Sources: alut-src-15.zip fgdata-part-15.zip flightgear-src-15.zip freeglut-src-15.zip lpng-src-15.zip OpenSceneGraph-src-15.zip PLIB-src-15.zip pthreads-src-15.zip simgear-src-15.zip zlib-1.2.3-src-15.zip


Older versions :-

fgvc9-exe-13.zip - contains just FlightGear.exe, if you already have all the OSG (63) 2.9.7 DLLs.
fgvc9rt13.zip - contains FlightGear.exe, and the many OSG DLL needed to run FG executable.
vc9sln13.zip - contains SETUPFG.BAT, the initial setup batch, vc9cfg??.zip, vc9chg??.zip, vc6dsw??.zip, boost-??.zip, rfgbats??.zip, vc9PLIB-??.zip, and various other files...
vc9-libs-13.zip - contains the 3rd party 'static' and DLL libraries, for linking.

Date Zip Size MD5
2010-03-03 fgvc9-exe-13.zip 1,869,955 1db2bb074b7fcd29dfe857c54922f17c
2010-03-03 fgvc9rt13.zip 6,025,434 a66ca92230e8270d7c1b4ce2cbb6ab36
2010-03-03 vc9sln13.zip 1,093,201 18437e1567850ee6b18636969a596e51
2010-03-03 vc9-libs-13.zip 6,571,504 93eff1800f39e8cc267604211c62995c


fgvc9-exe-12.zip - contains just FlightGear.exe, if you already have all the OSG (63) 2.9.7 DLLs.
fgvc9rt12.zip - contains FlightGear.exe, and the many OSG DLL needed to run FG executable.
vc9sln12.zip - contains SETUPFG.BAT, the initial setup bat, vc9cfg??.zip, vc9chg??.zip, vc6dsw??.zip, boost-??.zip, rfgbats??.zip, vc9PLIB-??.zip, and various other files ...
vc9-libs-12.zip - contains the 3rd party 'static' and DLL libraries, for linking.

Date Zip Size MD5
2010-02-13 fgvc9-exe-12.zip 1,866,548 1dd80169c5d97b3663c99c188f4e3a1b
2010-02-14 fgvc9rt12.zip 6,022,027 1bf54e315e20976a3c1b5d1fdb4efde2
2010-02-14 vc9sln12.zip 1,103,750 9582b306d3f492508c5c24a5057aba60
2010-02-13 vc9-libs-12.zip 6,571,500 be74b141cc8728b6d84ba539d8315819


fgvc9-exe-11.zip - contains just FlightGear.exe, if you already have all the OSG DLLs.
fgvc9rt11.zip - contains FlightGear.exe, and the many OSG DLL needed to run FG executable.
vc9sln11.zip - contains SETUPFG.BAT, the initial setup bat, vc9cfg09.zip, vc9chg09.zip, vc6dsw09.zip, boost-09.zip, rfgbats09.zip, vc9PLIB-09.zip, and various other files ...
vc9-libs-11.zip - contains the 3rd party 'static' and DLL libraries, for linking.

Date Zip Size MD5
2010-01-17 fgvc9-exe-11.zip 1,858,078 0f3308906ba46d21923f7334296be7f6
2010-01-17 fgvc9rt11.zip 6,492,842 e489f76a13885fdedea4b56ee6a7b62b
2010-01-17 vc9sln11.zip 1,059,763 48a1d73061b5635864e52d7da9757297
2010-01-17 vc9-libs-11.zip 6,499,232 63333d15e2f2063ba4b8043be52fe39b
More source zips corresponding to this build can be found in fileindex.htm


fgvc9rt09.zip - contains FlightGear.exe, and the many OSG DLL needed to run FG executable, built with MSVC9.
vc9sln09.zip - contains SETUPFG.BAT, the initial setup bat, vc9cfg09.zip, vc9chg09.zip, vc6dsw09.zip, boost-09.zip, rfgbats09.zip, vc9PLIB-09.zip, and various other files ...

Date Zip Size MD5
2009-07-11 fgvc9rt09.zip 5,812,497 3b9c852d615e64f3a667c36cbcbad94f
2009-07-11 vc9sln09.zip 507,624 66165d98865969683d00bc40e939e00a

fgvc7rt08.zip - contains FlightGear.exe, and the many OSG DLL needed to run FG executable, built with MSVC7.1.
vc7sln08.zip - contains SETUPFG.BAT, the initial setup bat, vc7cfg08.zip, vc7chg08.zip, vc6dsw08.zip, boost-08.zip, rfgbats08.zip, vc8PLIB-08.zip, and various other files ...

Date Zip Size MD5
2009-04-19 fgvc7rt08.zip 5,402,773 dbb763834f3f180f9ae4c8d02be16cc8
2009-04-19 vc7sln08.zip 498,544 118df4f7fa300ee22c61bb2ad4d14e36

fgvc9rt07.zip - contains FlightGear.exe, and the many OSG DLL needed to run FG executable.
vc9sln07.zip - contains SETUPFG.BAT, the initial setup bat, vc9cfg07.zip, vc9chg07.zip, vc6dsw07.zip, boost-07.zip, rfgbats07.zip, vc9PLIB-07.zip, and various other files ...
vc9sln05.zip - contains SETUPFG.BAT, the initial setup bat, vc9cfg05.zip, vc9chg05.zip, vc6dsw03.zip, boost-05.zip, rfgbats05.zip, and various other files ...
fgvc9rt05.zip - contains FlightGear.exe, and many OSG DLL needed to run, plus Openal-05.zip, with OpenAL DLLs, but these should be obtained from the OpenAL SDK - see prereq.htm ...

Date Zip Size MD5
2009-03-13 fgvc9rt07.zip 5,507,317 748108d43e7553b20448a3e5837d9ca1
2009-03-15 vc9sln07.zip 523,513 5463b43d850949df1d2e423db257cc9c
2008-11-28 vc9sln05.zip 512,607 2c343d685df9c5e5db1001eab7f772d6
2008-11-28 fgvc9rt05.zip 5,610,045 4559b6049e3a1901dc2a90aec890ede8
2008-11-28 vc9PLIB06.zip 4,538 870066ee1ccd8d409622947ccc183249

Also, if you want to 'patch' your current CVS/SVN source, to match this build, the chgdiff07.patch will do that. This is an alternative to using my vc9chg07.zip file, and allows you to review the changes I have made to each of the sources.
Older Version : fgfs-047.patch.txt This is an alternative to using my vc9chg05.zip.

vc9PLIB-07.zip is now included in vc9sln07.zip. The older vc9PLIB06.zip - Added 2008-12-13 is the same. They contain another copy of the modified PLIB/src/js/jsWindows.cxx, and my new jsName.cxx, which, if getting the joystick name from the Windows registry fails, uses the DirectInput interface to enumerate the FIRST working joystick found, and returns the full name. Of course, you have to make sure that 'name' is then exactly represented in WORK/data/Input/Joysticks XML files, under the manufacturers name. You can use my Joyinfo application to 'see' the name returned ... These 2 files are also in the vc9sln05.zip, in vc9chg05.zip ...


Not Recommended!!!:

As is becoming usual, I now add the COMPLETE source and data table with the above builds. Of course it is better if you download the real sources - see my prerequisites page - prereq.htm - and checkout, and download the various sources yourself.

WARNING: These are NOW very out-of-date sources!

File MD5 Size Date
fgfs-full-03.zip 5a2bfe901e4b420c962d969bf376962f 17,191,706 2008-11-30 12:23:20 (utc)
fgfs-data-03.zip e7500f10c5753614b0f460e556807a94 861,897,303 2008-11-26 15:25:12 (utc)
fg-build-27.zip c5944c2e1d53d9be55d04aef79323e75 70,626,084 2009-10-04 17:17:02 (utc)

Note, the fgfs-full-03.zip contains the SOURCE folder source. The SETUPFG.BAT must be used to create the WORK folder, and the fgfs-data-03.zip should be unzipped into a folder called 'data', in that WORK - see folders above - to conform to my  TSS  ;=)) The later fg-build-27.zip again contains the complete SOURCE folders, including FG 'data'. Although it contains some slightly CVS/SVN updated source, it is compatible with the 2009-07-11 build given above.



2008-12-06: This problem was later 'fixed' simply by UPDATING the ATI video drivers ... see fgfs-048.htm ;=))

I have a strange anomaly in the video rendering. On one ATI video card, in an XP powered machine, everything seems fine, but on another, is a Vista powered machine, most of the 'panel' instruments do not appear, but I found other had this same problem :-

Machine Dell01: In MS windows XP, with 256MB ATI Radeon X1300PRO - Good


Machine Dell02: In MS windows Vista, with ATI Radeon HD 2600 XT - BAD


I still have to work out why this BIG, UGLY difference ;=(( What can be causing the rendering to FAIL on this ATI Radeon HD 2600 XT card, when there is no problem with the ATI Radeon X1300PRO ???

And I tried it in a 3rd machine, named PRO-02, running XP SP3, with ATI Radeon 9600 Series - OK

On ATI Radeon 9600 Series

So it is just the ATI Radeon HD 2600 XT card. See FG forum :-
and maybe related -
Changing "point-sprites" from "true" to "false" did NOT work for me, and downloaded some updated drivers from ATI, and after a _LONG_ installation of Catalyst, and drivers, there was  NO PROBLEM  ;=() see fgfs-048.htm



Next is to build FGRUN - see fgfs-048.htm
Updated: 2010-01-17, 2008-12-07 and 2008-12-03 - Original: Friday, November 28, 2008.


Previous Update Notes:

2009-07-11: I hoped this was going to be a 'simple' update, but at first, it looked like some serious things had changed ;=))! Although I have a relative recent MS Windows SDK installed, v6.1, it does NOT include <GL/glext.h>, needed for the latest SVN version of OpenSceneGraph - YUK! There it was for all to see in osgviewer.cpp, #include <GL/glext.h> and #include <GL/wglext.h>, neither of which are available in my current Windows Vista! But, thankfully, this was later reversed ;=()

Per the OpenGL page - http://www.opengl.org/wiki/Getting_started , under OpenGL 2.0+ and extensions, they suggest downloading the two files - glext.h, and wglext.h from the Extensions Registry, and put then in your compiler's GL folder. For good measure, I also added glxent.h at the same time. And of course, in Vista, one has to remember to run in Administrator mode to add these files to C:\Program Files\Microsoft SDKs\Windows\v6.1\Include\gl ...

BUT, in reading the OSG forum messages, it seems this is some experimental code, and the suggestion was to revert to the previous SVN, which I did with the command ...osg..> svn up -r PREV, and ended up back at revision 10453, with an applications/osgviewer/osgviewer.cpp WITHOUT these additional inclusions! This is one of the problem chasing the 'latest' in a fast moving source. In Ubuntu, due to this type of error, I have reverted to only using the latest RELEASED version of OSG!

2009-04-19: Minor update, using MSVC7.1, but remember this  TWO SOLUTION SYSTEM (TSS)  uses MSVC6 DSW/DSP build files, thus will function with _ALL_ subsequent version of MSVC. Just allow the newer version to convert the build files to its own format.

2009-03-15: An important update, using cvs 2009-03-13, which FIXED some important items. Ensure you re-download the #07 zips, if by any chance you downloaded those dated 2009-03-12.
2008-11-28: This carries on from page fgfs-045.htm, which is still worth reading ...


OSG CMake images

View of CMake, after configure, and generate steps. Particularly note the PNG_LIBRARY, PNG_PNG_INCLUDE, ZLIB_LIBRARY and ZLIB_INCLUDE lines, since support for PNG graphics is needed in SG/FG...

image a
image a
image a
image a
image a
image a
image a
image a

While this shows many, MANY items NOT FOUND, and some WARNING, there are NO red error entries, and the generation of the MSVC build files completed without problems.



EOP - fgfs-047.htm

checked by tidy  Valid HTML 4.01 Transitional