-HowTo compile FlightGear with Microsoft Visual C++ 6.0
-======================================================
-
-This HowTo is written for FlightGear 0.7.4. You might be able to
-figure out how to get any other version running by reading it as the
-steps are quite simmilar.
-
-First you need FlightGear 0.7.4 or on of the current snapshots from
-
- ftp://ftp.flightgear.org/pub/fgfs/Source
-
-or
-
- ftp://ftp.flightgear.org/pub/fgfs/Source/snapshots
-
-The you need the libraries that it depends on. This is SimGear 0.0.9
-and plib 1.1.11. Those libraries can be found at
-
- ftp://ftp.flightgear.org/pub/fgfs/Source
-
-and
-
- http://plib.sourceforge.net/
-
-Then you've got two posibilities. Either use the MSVC workspace that
-you can find at
-
- ftp://ftp.flightgear.org/pub/fgfs/Source
-
-or create your own workspace.
-
-The premade workspace will give you a quicker start (it takes some
-time to create your own), but it will most probably be outdatet so
-that you'd have to fix it.
-
-Any wich way you choose you'll have to create the plib library now
-(i.e. before you touch anything from FGFS). You can either use the
-workspace that comes with it (most probably outdated) or create your
-own ones. The way to do that is very similar to those of the creation
-of the SimGear workspaces which is described below.
-
-If you use the premade workspace (one for SimGear and one for
-FlightGear) you'll have to open the SimGear one first and compile it,
-then the FlightGear one. After that you should be read to run FGFS.
-
-The universal approach is by creating your own workspace.
-
-Make sure that you've compiled PLIB sucessfully and that you've got in
-...\plib (I'm using ...\ for the directory where all your projects
-are. The name of the directory doesn't matter as all paths will be
-relative):
-
- ...\plib\plib.lib
- ...\plib\fnt.h
- ...\plib\plib\js.h
- ...\plib\pu.h
- ...\plib\sg.h
- ...\plib\sl.h
- ...\plib\sm.h
- ...\plib\ssg.h
- ...\plib\ssgKeyFlier.h
-
-(This also important when you are using the premade workspaces)
-
-Now unzip SimGear-0.0.9 into ...\SimGear (NOTE: There's no -0.0.9 at
-the end of the directory) and run MSVC. Create a new and empty
-workspace, call it 'SimGear Workspace' and make sure it'S path is
-'...\SimGear\SimGear Workspace'
-
-Then you'll have to add lots of new projects. The best way is by right
-clicking on the workspace and select 'Add new project'. Select
-Win32-Library (static) in the dialog and set the name to the first
-subdir in ...\SimGear\simgear. That'll be most probably 'bucket'. The
-path will automatically be set to ...\SimGear\bucket. Then press OK as
-often as necessary (we don't need any of the checkboxes that'll
-apear).
-
-Repeat that with all subdirectories. (If you'll open both, MSVC and
-the Explorer it'll be quite fast). With SimGear 0.0.9 you should have
-11 projects.
-
-Now do it the last time and create a project with the name 'simgear'
-and make it dependant on all other projects (through the projects
-menu).
-
-Now it's time to fill the projects. Right click on the first one and
-select the item to add new files. In the file selector select the
-files of the corresponding directory. That'll be e.g. for the 'bucket'
-project:
-
- ...\SimGear\simgear\bucket\newbucket.cxx
- ...\SimGear\simgear\bucket\newbucket.hxx
-
-The files for the MetaKit live in
-
- ...\SimGear\simgear\metakit\src\
-
-and
-
- ...\SimGear\simgear\metakit\include\
-
-NOTE: borc.h, gnuc.h, mk4dll.h and mwcw.h aren't needed and shouldn't
-be included
-
-Then add to all projects the additional search path
-'..\..\,..\..\..\,..\..\simgear\'. Do that by pressing Alt-F7,
-selecting all projects, selecting 'all configurations', selecting the
-'C/C++' tab, selecting 'preprocessor' and then add that path to the
-additional include path.
-
-The 'metakit' project needs a special addition to its include path:
-'..\..\\simgear\metakit\win,..\..\simgear\metakit\include'
-
-All projects need the additon of a few preprocessor defines. You can
-set those in the Alt-F7 dialog on the same tab where you set the
-include paths. The necessary defines are:
-
- HAVE_WINDOWS_H and HAVE_RAND
-
-Now we are nearly ready for compiling SimGear. The only thing missing
-is the exclusion of all those test programms. These programms are
-
- debug: logtest.cxx
- magvar: testmagvar.cxx
- metar: Drvmetar.c
- serial: testserial.cxx
- zlib: example.c
- zlib: maketree.obj
- zlib: minigzip.c
-
-To exclude them, press Alt-F7, select 'all configurations' and then
-select all those files, and then exlclude those files.
-
-Last thing to do before you can compile SimGear is to press Alt-F7
-once again, select simgear and all configurations and the general
-tab. Add '..\..\' to the directory for the output files.
-
-Finally you can hit compile.
-
-When you've done everything correctly you'll have a 'simgear.lib' at
-...\SimGear\.
-
-Congratulations for completing step 1.
-
-To compile FlightGear you'll have to do quite similar steps.
-
-Make sure that FlighGear lives in ...\FlightGear, create a new and
-empty workspace named 'FlightGear Workspace' at
-'...\FlightGear\FlightGear Workspace'. Now add the projects that are
-named after the directories in ...\FlightGear\src.
-
-NOTE: Create a project named 'FDM' as well as projects named
- 'FDM Balloon', 'FDM JSBsim', ...
-NOTE: There'll even be a project named 'FDM JSBsim Filtersjb'
-NOTE: The directory 'Include' doesn't get its own project
-NOTE: The directory 'Main' is special. It's project name is
- 'FlightGear' and it's not a win32 libraray. It's a
- win32-console application.
-
-Then it's time to add the files in those directories to the
-projects. (See description of SimGear for the details).
-
-Next step is to set the dependancies. 'FDM JSBsim' depends on 'FDM
-JSBsim Filtersjb', 'FDM' depends on the other 'FDM ...' projects and
-'FlightGear' depends on all other projects (but not 'FDM Ballon'
-etc. as other projects do already depend on them).
-
-NOTE: No project is allowed to depend on 'NetworkOLK' as it isn'T
-compatible with MSVC yet.
-
-Now make sure that the 'FlightGear' project is the active one (that's
-the bold one).
-
-Then add those include paths: ..\..\..\SimGear\,..\..\src,..\..\src\Include,..\..\..\,..\..\..\SimGear\simgear\metakit\include\
-
-Exclude the following files:
-
-airports: buildsimple.cxx
-Navaids: testnavs.cxx
-Joystick: js_demo.cxx
-FDM JSBsim: JSBSim.cpp
-
-Wolfram Kuss (w_kuss@rz-online.de) figured out that the following
-files also have to be excluded:
-
-LaRCsim/c172_main.c
-airports/testair
-airports/genrunwas
-airports/gensimple
-the rest of airports ??
-scenery/test
-time/win32test
-time/test_event
-
-Add those preprocessor defines
-
-HAVE_WINDOWS_H, FGFS, ENABLE_PLIB_JOYSTICK
-
-Add those libraries to the linker
-
-plib.lib simgear.lib ws2_32.lib
-
-and those paths to the library paths
-
-..\..\..\plib,..\..\..\simgear
-
-Now press Alt-F7 again, select 'FlightGear' and 'all
-configurations'. Now specify your FG_ROOT/bin directory as the
-directory for the output data and FG_ROOT as the working directory.
-
-Now you are ready to compile FGFS! Have fun.
-
-NOTE: Wolfram Kuss (w_kuss@rz-online.de) Figured out that a lot of
-files are useing header files from SimGear. This leads to problems
-with using precompiled headers as long as you didn't declare all
-dependencies. He simply turned off precompiled headers.
-
-NOTE: As most developers aren't using MSVC the source code is probably
-broken. If that's the case and you know how to fix it it'll be nice if
-you could mail a bug report with it's fix to the FlightGear
-development list.
+Use FlightGear.sln to compile fgfs executable for Win32 or x64 architectures with Visual Studio 2008.
+Previous versions of Visual Studio are not officially supported anymore.
+
+Precompiled librairies and headers for compiling Win32 executables with VS2008 :
+ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/MSVC/fgfs-win32-VS90-3rdParty+OSG-20110801.zip
+
+Precompiled librairies and headers for compiling x64 executables with VS2008 :
+ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/MSVC/fgfs-x64-VS90-3rdParty+OSG-20110801.zip
+
+These two archives only contain 'release' versions of librairies and executables. In addition,
+the archives below contain 'debug' version of libraries and should be dezipped over the previous one.
+ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/MSVC/fgfs-win32-VS90-3rdParty+OSG-20110801-debug.zip
+ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/MSVC/fgfs-x64-VS90-3rdParty+OSG-20110801-debug.zip
+
+The VS2008 / v9.0 project files assume the directory layout below :
+
+Win32 build :
+ * any_directory_on_any_drive /
+ 3rdParty / ( includes plib, fltk, zlib, libpng, libjpeg, libtiff, freetype, libsvn, gdal, ...
+ bin /
+ include /
+ lib /
+ boost_1_44_0 /
+ boost /
+ lib /
+ source / ( Flightgear CVS directory - It can also be renamed FlightGear or anything else
+ src /
+ projects /
+ VC90 /
+ Win32 / ( generated at build time
+ Debug / ( Debug executable
+ Release / ( Release executable
+ FlightGear.sln ( Main solution
+ utils /
+ install /
+ msvc90 /
+ OpenSceneGraph / ( OSG CMake install
+ bin /
+ include /
+ lib /
+ SimGear / ( SimGear CVS directory
+ simgear /
+ projects /
+ VC90 /
+
+3rdParty, boost_1_44_0 and install/msvc90 are included in the Win32 3rdParty archive.
+
+x64 build :
+ * any_directory_on_any_drive /
+ 3rdParty.x64 / ( includes plib, fltk, zlib, libpng, libjpeg, libtiff, freetype, ...
+ bin /
+ include /
+ lib /
+ boost_1_44_0 /
+ boost /
+ lib64 /
+ source / ( Flightgear CVS directory - It can also be renamed FlightGear or anything else
+ src /
+ projects /
+ VC90 /
+ x64 / ( generated at build time
+ Debug / ( Debug executable
+ Release / ( Release executable
+ FlightGear.sln ( Main solution
+ utils /
+ install /
+ msvc90-64 /
+ OpenSceneGraph / ( OSG CMake install
+ bin /
+ include /
+ lib /
+ SimGear / ( SimGear CVS directory
+ simgear /
+ projects /
+ VC90 /
+
+3rdParty.x64, boost_1_44_0 and install/msvc90-64 are included in the x64 3rdParty archive.
+
+Typical setup should decompose into the following steps :
+
+ 1. Install Visual Studio 2008 Express (http://msdn.microsoft.com/fr-fr/express/aa975050.aspx)
+ 2. Install msysGit (http://code.google.com/p/msysgit/)
+ 3. Create a new directory, say D:\FGFSDevel (or anything else)
+ 4. Unzip precompiled Win32 3rd party archive in it
+ 5. Open a Git Bash session and cd to the new directory ( cd /d/FGFSDevel )
+ 6. Get SimGear sources from Gitorious : git clone git://gitorious.org/fg/simgear.git SimGear
+ 7. Get FlightGear source from Gitorious : git clone git://gitorious.org/fg/flightgear.git FlightGear
+ 8. Go to D:\FGFSDevel\FlightGear\projects\VC90 and double-click on FlightGear.sln
+ 9. Select the "Release" configuration
+ 10. Open file D:\FGFSDevel\SimGear\simgear\version.h.in and change @VERSION@ into "2.0.0" or any current version
+ 11. Save file as version.h in the same directory
+ 12. Start build (usually F7)
+ 13. Get the data from Gitorious too : git clone git://gitorious.org/fg/fgdata.git fgdata
+ 14. Wait...
+ 15. Add <any_directory_on_any_drive>/install/msvc90/OpenSceneGraph/bin and <any_directory_on_any_drive>/3rdParty/bin to your PATH environment variable
+ 16. Enjoy - programs are in D:\FGFSDevel\FlightGear\projects\VC90\Win32\Release
+
+It is also possible to compile a Debug version. This is only useful when hacking the code because
+a Debug version is way slower than the Release one.
+
+The 64bit build is only available to people having the Professional edition of Visual Studio 2008. In that case, 15. above should be :
+ 15. Add <any_directory_on_any_drive>/install/msvc90-64/OpenSceneGraph/bin and <any_directory_on_any_drive>/3rdParty.x64/bin to your PATH environment variable
+
+When the manual build works, it is possible to start it from the command line. This is useful
+when setting up a build server or automating the process of retrieving the code and building
+it in a scheduled task. To do that :
+
+ 1. open a command line window
+ 2. execute "C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat"
+ or "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat" in a
+ 64bit environment (Vista 64-bit or Windows7 64-bit)
+ You should see : "Setting environment for using Microsoft Visual Studio 2008 x86 tools."
+ printed in the console
+ ( To start 64-bit build, the right environment is set with :
+ "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" amd64
+ )
+ 3. cd to the FlightGear project directory :
+ D:
+ cd \FGFSDevel\FlightGear\projects\VC90 (for example)
+ 4. start the build with the command line below :
+ msbuild FlightGear.sln /p:Configuration=Release /m
+ or
+ msbuild FlightGear.sln /p:Configuration=Debug /m
+
+That's all...
+
+Note: you may experience the error below running the msbuild command :
+FlightGear\projects\VC90\FlightGear.sln : error MSB4018: The "ResolveVCProjectOutput" task failed unexpectedly.
+...(lots of additionnal messages)
+
+In that case, remove the /m switch from the command line.