1 HowTo compile FlightGear with Microsoft Visual C++ 6.0
2 ======================================================
4 This HowTo is written for FlightGear 0.7.4. You might be able to
5 figure out how to get any other version running by reading it as the
6 steps are quite simmilar.
8 First you need FlightGear 0.7.4 or on of the current snapshots from
10 ftp://ftp.flightgear.org/pub/fgfs/Source
14 ftp://ftp.flightgear.org/pub/fgfs/Source/snapshots
16 The you need the libraries that it depends on. This is SimGear 0.0.9
17 and plib 1.1.11. Those libraries can be found at
19 ftp://ftp.flightgear.org/pub/fgfs/Source
23 http://plib.sourceforge.net/
25 Then you've got two posibilities. Either use the MSVC workspace that
28 ftp://ftp.flightgear.org/pub/fgfs/Source
30 or create your own workspace.
32 The premade workspace will give you a quicker start (it takes some
33 time to create your own), but it will most probably be outdatet so
34 that you'd have to fix it.
36 Any wich way you choose you'll have to create the plib library now
37 (i.e. before you touch anything from FGFS). You can either use the
38 workspace that comes with it (most probably outdated) or create your
39 own ones. The way to do that is very similar to those of the creation
40 of the SimGear workspaces which is described below.
42 If you use the premade workspace (one for SimGear and one for
43 FlightGear) you'll have to open the SimGear one first and compile it,
44 then the FlightGear one. After that you should be read to run FGFS.
46 The universal approach is by creating your own workspace.
48 Make sure that you've compiled PLIB sucessfully and that you've got in
49 ...\plib (I'm using ...\ for the directory where all your projects
50 are. The name of the directory doesn't matter as all paths will be
61 ...\plib\ssgKeyFlier.h
63 (This also important when you are using the premade workspaces)
65 Now unzip SimGear-0.0.9 into ...\SimGear (NOTE: There's no -0.0.9 at
66 the end of the directory) and run MSVC. Create a new and empty
67 workspace, call it 'SimGear Workspace' and make sure it'S path is
68 '...\SimGear\SimGear Workspace'
70 Then you'll have to add lots of new projects. The best way is by right
71 clicking on the workspace and select 'Add new project'. Select
72 Win32-Library (static) in the dialog and set the name to the first
73 subdir in ...\SimGear\simgear. That'll be most probably 'bucket'. The
74 path will automatically be set to ...\SimGear\bucket. Then press OK as
75 often as necessary (we don't need any of the checkboxes that'll
78 Repeat that with all subdirectories. (If you'll open both, MSVC and
79 the Explorer it'll be quite fast). With SimGear 0.0.9 you should have
82 Now do it the last time and create a project with the name 'simgear'
83 and make it dependant on all other projects (through the projects
86 Now it's time to fill the projects. Right click on the first one and
87 select the item to add new files. In the file selector select the
88 files of the corresponding directory. That'll be e.g. for the 'bucket'
91 ...\SimGear\simgear\bucket\newbucket.cxx
92 ...\SimGear\simgear\bucket\newbucket.hxx
94 The files for the MetaKit live in
96 ...\SimGear\simgear\metakit\src\
100 ...\SimGear\simgear\metakit\include\
102 NOTE: borc.h, gnuc.h, mk4dll.h and mwcw.h aren't needed and shouldn't
105 Then add to all projects the additional search path
106 '..\..\,..\..\..\,..\..\simgear\'. Do that by pressing Alt-F7,
107 selecting all projects, selecting 'all configurations', selecting the
108 'C/C++' tab, selecting 'preprocessor' and then add that path to the
109 additional include path.
111 The 'metakit' project needs a special addition to its include path:
112 '..\..\\simgear\metakit\win,..\..\simgear\metakit\include'
114 All projects need the additon of a few preprocessor defines. You can
115 set those in the Alt-F7 dialog on the same tab where you set the
116 include paths. The necessary defines are:
118 HAVE_WINDOWS_H and HAVE_RAND
120 Now we are nearly ready for compiling SimGear. The only thing missing
121 is the exclusion of all those test programms. These programms are
124 magvar: testmagvar.cxx
126 serial: testserial.cxx
131 To exclude them, press Alt-F7, select 'all configurations' and then
132 select all those files, and then exlclude those files.
134 Last thing to do before you can compile SimGear is to press Alt-F7
135 once again, select simgear and all configurations and the general
136 tab. Add '..\..\' to the directory for the output files.
138 Finally you can hit compile.
140 When you've done everything correctly you'll have a 'simgear.lib' at
143 Congratulations for completing step 1.
145 To compile FlightGear you'll have to do quite similar steps.
147 Make sure that FlighGear lives in ...\FlightGear, create a new and
148 empty workspace named 'FlightGear Workspace' at
149 '...\FlightGear\FlightGear Workspace'. Now add the projects that are
150 named after the directories in ...\FlightGear\src.
152 NOTE: Create a project named 'FDM' as well as projects named
153 'FDM Balloon', 'FDM JSBsim', ...
154 NOTE: There'll even be a project named 'FDM JSBsim Filtersjb'
155 NOTE: The directory 'Include' doesn't get its own project
156 NOTE: The directory 'Main' is special. It's project name is
157 'FlightGear' and it's not a win32 libraray. It's a
158 win32-console application.
160 Then it's time to add the files in those directories to the
161 projects. (See description of SimGear for the details).
163 Next step is to set the dependancies. 'FDM JSBsim' depends on 'FDM
164 JSBsim Filtersjb', 'FDM' depends on the other 'FDM ...' projects and
165 'FlightGear' depends on all other projects (but not 'FDM Ballon'
166 etc. as other projects do already depend on them).
168 NOTE: No project is allowed to depend on 'NetworkOLK' as it isn'T
169 compatible with MSVC yet.
171 Now make sure that the 'FlightGear' project is the active one (that's
174 Then add those include paths: ..\..\..\SimGear\,..\..\src,..\..\src\Include,..\..\..\,..\..\..\SimGear\simgear\metakit\include\
176 Exclude the following files:
178 airports: buildsimple.cxx
179 Navaids: testnavs.cxx
180 Joystick: js_demo.cxx
181 FDM JSBsim: JSBSim.cpp
183 Wolfram Kuss (w_kuss@rz-online.de) figured out that the following
184 files also have to be excluded:
190 the rest of airports ??
195 Add those preprocessor defines
197 HAVE_WINDOWS_H, FGFS, ENABLE_PLIB_JOYSTICK
199 Add those libraries to the linker
201 plib.lib simgear.lib ws2_32.lib
203 and those paths to the library paths
205 ..\..\..\plib,..\..\..\simgear
207 Now press Alt-F7 again, select 'FlightGear' and 'all
208 configurations'. Now specify your FG_ROOT/bin directory as the
209 directory for the output data and FG_ROOT as the working directory.
211 Now you are ready to compile FGFS! Have fun.
213 NOTE: Wolfram Kuss (w_kuss@rz-online.de) Figured out that a lot of
214 files are useing header files from SimGear. This leads to problems
215 with using precompiled headers as long as you didn't declare all
216 dependencies. He simply turned off precompiled headers.
218 NOTE: As most developers aren't using MSVC the source code is probably
219 broken. If that's the case and you know how to fix it it'll be nice if
220 you could mail a bug report with it's fix to the FlightGear