README.MSVC8.TXT - circa 13 April, 2006 How to compile FlightGear with Microsoft Visual C++ 6/7/8 ========================================================= At the bottom is some simple advice, and some links, for using MSVC7 to compile FlightGear. The MSVC8 build files are now part of FlightGear CVS. To be sure, there are nearly as MANY different approaches as there are developers ;=)) this only describe ONE way ... enjoy ... Directory Structure: The arrangement of the directories is of paramount importance ... The MSVC6 DSW/DSP build files provided must be adjusted if you do not use this specific directory structure! Choose a root directory to hold all the source of FlightGear, and its dependant projects. Here FG0910 if used, with a comment after the # ... FG0910\pthreads # if pthreads is used \freeglut # if freeglut is used \SimGear # CVS, source of SimGear \zlib-1.2.3 # Unpacked tar.gz of zlib \PLIB # CVS, source of PLIB \AL\OpenAL # CVS, of sound library \source # CVS, source of FlightGear Each of the dependant project MUST be compiled BEFORE compiling and linking FlightGear! Each of the dependant projects, except zlib, are available by CVS, but quite often a tar ball, or zip of the source will also be available. The CVS of freeglut may be in a freeglut\freeglut folder. You can either adjust this double folder arrangement, or adjust the build files accordingly. Also the Microsoft SDK includes OpenGL, and this can be used instead of freeglut. Configuration: Most of the initial configuration comes from the file config.h. This is not in the CVS source of FlightGear, but there is a config.h-msvc? file provided in the source\src\include folder. There is a custom build step in the MSVC6 DSP file to copy this config.h-msvc? to config.h, but you can also do this manually, and at the same time change items such as - #define ENABLE_THREADS 1 Change this to - #undef ENABLE_THREADS if you do not want to include thread support ... for example ... Usually, when you installed MSVC, and the matching SDK, the Visual Studio tool is configured with all the necessary system 'include' file paths, as well as those to the 'system' libraries, and executable files. In MSVC6, this is under the menu item, Tools -> Options, Directories tab. In MSVC7.1, it is Tools -> Options, Projects folder, VC++ Directories. In MSVC8, it is Tools -> Options, Projects and Solutions tree, VC++ Directories. The MSVC project files attempt to provide the 'Additional Include Directories' for each of the dependant projects. As mentioned, this will need adjusting if you have used other than the above folder structure, or, for example, you have included the project version in the folder name, like say 'freeglut-2.4.0' ... Also, certain projects, like say OpenAL also have a SDK, which can be used, but be aware SimGear and FlightGear use , or, in the MAC OS, to include these headers, so you MUST make sure the header file al.h is in the appropriate folder in the source you are using. Compiling FlightGear: Whether you are using MSVC6, MSVC7.1 or MSVC8, you can load the FlightGear.DSW project file. As mentioned, below there is a link to MSVC7 project files, and the CVS source of FlightGear now include a MSVC8 FlightGear.SLN file. The choice is yours. One of the most common problems is the runtime libraries chosen. Whether you are using pthreads, or not, the best choice is Multithreaded. This is /MTd for the Debug configuration, and /MT for the Release. MAKE SURE EVERY DEPENDANT PROJECT IS COMPILED AND LINKED USING THE SAME RUNTIME LIBRARY. Each of the dependant projects have a MSVC6 DSW/DSP build file set, and sometimes later SLN/VCPROJ files, BUT not all will default to this Multithreaded runtime library choice. Save yourself some time, and grief by always checking this before doing the build. Each version of MSVC has its own quirks and foibles. As you can read below, MSVC6 causes the most problems. Lots of physical modification must be made to the code to get it to compile, but it is JUST possible, with a LOT OF WORK. The later MSVC7, and the recent MSVC8 seem to fair better with this large body of cross-platform code, but they too sometimes require code tweaks. Like others, I have dedicated part of my site to FlightGear, where I put lots of 'personal' notes about the build and running process - http://geoffmclane.com/fg And another developers view point - How to compile FlightGear with Microsoft Visual C++ 7.0 ====================================================== I am receiving an increasing number of request for working project files for MSVC. While I can't reply specifically to everybody, I packed my current, unedited, project files here : ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/MSVC/ They are for MSVC 7. I am not trying to compile with MSVC 6 anymore because it is an old compiler ( released 5 years ago ) that has serious bugs and limitations that would make the source ugly. For those that want to try, there are already .dsp files in plib, SimGear and FlightGear source trees. Support request must be directed to the mailing list. Pthread support for Windows can be obtained here: http://sourceware.org/pthreads-win32/ EOF - readme.msvc8.txt