FlightGear - October, 2005

back

Having moved back to Antony, France from Sydney, Australia, in September 2005, it took many week to find, choose, and buy a new computer, and then some more time to research, choose, and get an ADSL connection ... then I was ready to play with FlightGear again. ;=)). 

The first step was to do a CVS update. I use the command line version, rather than the WinCVS, that is also available. To my surprise, the update of FlightGear source, and data folders, literally took MANY HOURS. Not sure why! But after the first update, subsequent updates were very quick - just MINUTES, instead of hours ... of course, after setting the CVSROOT environment variable, I used the common 'cvs up -dP' ... I have all this in a batch file, so I can navigate the my FGCVS folder, and use my FGUPD batch file, which also sets the correct environment variables ...

Also, as a matter of style, I never directly build FlightGear, and all its dependant components in this FGCVS folder ... I use a copy of the FGCVS folder, to say a FG0981 folder, where I perform the build. When I eventually get FlightGear built, I do not like CVS to update source files directly. I do an update to FGCVS, then use various folder compare tools to review what has been changed. This has saved me many times from directly changing some source, that may lead to incompatibilities. I know this defeats a little bit of the main purpose of CVS, but it gives me a chance to review all the changes, before applying them.

 The folder comparison tools I use are (a) my own DC4W.exe - Directory Compare, v4, for Windows, and (b) Beyond Compare - a fabulous commercial tool, which originally appeared to have commenced with the same source as my DC4W, which was some Microsoft sample code, shipped with an SDK!

The folders I have in my FGCVS are as follows - PLIB, SimGear/source, FlightGear/source, FlightGear/data, TerraGear, fgsd, Atlas, fgrun, are all in my single UPDFG batch file. Others are AL/openal, blender, grass51, pthreads, python, tidy, wxJS, wxWidgets, which I must update manually. One other folder, not using CVS is jpeg/jpeg-6b. Note, not all these folder are directly related to FlightGear ...

I am still surprised why the first CVS update, after quite a long time, takes such a long time. There are literally thousands of packets sent and received on my ADSL connection, before the actual file update commences. Once the file update commences, things move quite quickly to complete the update. And an immediate command 'cvs up -dP', after that initial update, will be quite quick, as usual ... very puzzling ... It seems quite important to do a CVS update REGULARLY ;=)) just to keep the time taken to a minimum ...

Naturally I have joined the FlightGear, and TerraGear developers boards. I use another email address for this, geoffair, also at hot-mail, so the next thing is to catch up a little on what has been happening. I get the posted messages sent to me in batch, or digest mode. Since I have not cleared this mail box for over a month, and I forgot to turn off the sending, I have over 80 batched message to read through ... This is perhaps not particularly essential, as many things that are discussed are not in my sphere of interest, but again I like to know what is happening ;=)) pause to read the message ...

Wow, that took a while. I had not read the messages for a little over a month, and there were some 80 digest batch mode messages. Assuming an average of 5 individual posts in each digest, or batch, some are more, some less, that is around 400 messages a month!

PLIB Build

So I start compiling with PLIB. The first action is to COPY the FGCVS/PLIB folder to my chosen work folder, FG0981/PLIB. Open Microsoft Visual Studio 2003 v7.1.3088, using .NET Framework 1.1 (MSVC7) ... Open project, and navigate and open plib.dsw ... I am warned that some projects need to be converted to this MSVC7, and will not be subsequently usable by earlier version ... I click OK for ALL ...

Next, as a matter of habit, I check the various project properties ... the main items I look for is that it is building a Static Library, in the General tab, and that the Runtime Library is Multi-threaded Debug (/MTd), for debug, and Multi-threaded (/MT). for release build. Over time, I have learned this runtime library can really mess things up, but you only learn this sad fact right at the end, during the final LINK of FlightGear, when you get thousands of 'conflict' errors ...

This is tedious check since you must select each of the 12 projects in turn, and then repeat the same after changing the build to Release from Debug, and of course finally one must select plib as the Start-up project, then you are ready to press F7, Build All ...

For no particular reason, other than it is the default active configuration, I choose to build the debug version first. This time I only get a few warnings, and one error. One of the warnings is -
ssgaFire.cxx(129) : warning C4800: 'GLboolean' : forcing value to bool 'true' or 'false' (performance warning)
which I tend to ignore, and will omit hereafter. Exactly WHY the MS compilers emit this warning is not entirely clear ...

The next warning -
ssgLoad3ds.cxx(771) : warning C4554: '&' : check operator precedence for possible error; use parentheses to clarify precedence
I decide to 'fix', by adding brackets, like (flags & 7), but not sure this is really necessary ...

The next fatal error is puzzling -
c1xx : fatal error C1083: Cannot open source file: '.\puAuxList.cxx': No such file or directory
It really appears this file does NOT exist anywhere in PLIB, so I choose to delete it from the particular project ...

I am rewarded with a final -
Build: 13 succeeded, 0 failed, 0 skipped
As usual with PLIB, I note that a whole bunch of header files have been copied to the FG0981/PLIB root folder, and there are a dozen new static libraries, all with a '_d', like fnt_d.lib there also.

I switch to the Release configuration, and push F7, build all, again ... Again, I am rewarded with -
Build: 13 succeeded, 0 failed, 0 skipped
and now have some 24 static libraries in the FG0981/PLIB root. I make sure I push 'Save All' in MSVC7, ready to switch to the next project.

OpenAL Build

Again, I xcopy /E the FGCVS/AL/openal folder to FG0981/AL. Note the shortening of the folder name - this helps later, and not quite sure why my CVS is two folders down. Also, since I am not so familiar with building this project, I check first what *.dsw, *.sln files exist, and what *.vcproj files there are ... It looks like the are 3 important projects, ignoring the 'test' projects, ALc, ALu, and Router ... I choose to load the OpenAL.sln, in the win folder ...

As usual, I begin checking the properties, C++ tab, Code Generation, and see that ALC for example is set to Single-threaded Debug (/MLd) as the Runtime Library ... this is why I make this CHECK EVERY TIME ... This will cause LOTS of problems with the LINK, but you will not know that until MUCH LATER ...

So I begin changing each project, debug build, to Multi-threaded Debug (/MTd), and note the Router project is already set to that ... then the release ... Maybe there is not a particular problem with Single and Multi-threaded, and at present the MSVC7 version of FlightGear is NOT yet multi-threaded, BUT I like to keep them ALL THE SAME ...

During the build, I get several LINK warnings -
LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
which I choose to ignore ... I end up with 8 static libraries, that were not there before, 4 in Debug folder, and 4 in Release folder ... I wonder which ones I will later link with ... ALc.lib, ALu.lib, OpenAL32.lib, and wrap_oal.lib ... Jumping ahead, I later learned I must also build the alut.sln, for the alut.dll, and install it ... but this is covered below ...

SimGear Build

First, an xcopy /E from FGCVS/SimGear to FG0981/SimGear. There appears no *.sln MSVC7 file yet, so I use the SimGear.DSW ... BUT, before loading it, I remember that you also have to unpack the source/src-libs/zlib-1.1.4.tar.gz, into a zlib-1.1.4 folder ...

On loading source/SimGear.dsw, I get two (2) warnings that mklib.dsp and zlib.dsp, are corrupted, and can not be opened. I delete them from the project. Since mklib.dsp (metakit) is no longer required, it can be forgotten, and I add source/src-libs/zlib.dsp to the project, which presents no problem ... Although these two projects are together in the SimGear.dsw, they are each completely independent of each other ...

As usual, I check the Properties, C++ tab, Code Generation, and find that while the Debug configuration uses the Multi-threaded runtime library, it is NOT the debug version ... And expanding the SimGear Solution Explorer, I note the file simgear_config.h.vc5, and this reminds me that this must be saved as simgear_config.h ... in the same folder ...

Pushing F7, build all, is finished too quickly I think ... ah, that's because there are errors. The first is -
c:\FG0981\SimGear\source\simgear\constants.h(44) : fatal error C1083: Cannot open include file: 'plib/sg.h': No such file or directory
This means that the include path to PLIB is not valid ...

The present Properties, C++, General tab shows the include path as -
.,..,.\SimGear,.\SimGear\metakit-2.4.3\include,..\SimGear\zlib-1.1.4
First, as mentioned, metakit (mklib.dsp) is no longer required, so I remove this; And since SimGear.dsw in two layers down, SimGear/source, the '..', must be changed to '..\..', to match the '#include <plib/sg.h> in constants.h ...

The next fatal error, is a similar problem -
c:\FG0981\SimGear\source\simgear\sound\sample_openal.hxx(49) : fatal error C1083: Cannot open include file: 'AL/al.h': No such file or directory
By searching for al.h, in my FG0981/AL folder, it is found at C:\FG0981\al\include\AL, so I add '..\..\AL\include' to the Additional include path ...

And the next, while compiling xmlsound.cxx
c:\FG0981\SimGear\source\simgear\sound\sample_openal.hxx(50) : fatal error C1083: Cannot open include file: 'AL/alut.h': No such file or directory
Searching for alut.h in the AL folder finds it at C:\FG0981\al\alut\include\AL, which indicates I should add '..\..\AL\alut\include' to the additional include directories ...

The next build run emitted a set of warnings -
c:\FG0981\SimGear\source\simgear\sound\sample_openal.cxx(63) : warning C4800: 'ALuint' : forcing value to bool 'true' or 'false' (performance warning)
c:\FG0981\SimGear\source\simgear\sound\sample_openal.cxx(111) : warning C4996: 'alutLoadWAVFile' was declared deprecated
c:\FG0981\AL\alut\include\AL\alut.h(98) : see declaration of 'alutLoadWAVFile'
c:\FG0981\SimGear\source\simgear\sound\sample_openal.cxx(124) : warning C4996: 'alutUnloadWAV' was declared deprecated
c:\FG0981\AL\alut\include\AL\alut.h(101) : see declaration of 'alutUnloadWAV'
c:\FG0981\SimGear\source\simgear\sound\sample_openal.cxx(175) : warning C4996: 'alutUnloadWAV' was declared deprecated
c:\FG0981\AL\alut\include\AL\alut.h(101) : see declaration of 'alutUnloadWAV'

which I will ignore for now, since there is another fatal error -

This time it is a missing zlib.h when compiling texture.cxx -
c:\FG0981\SimGear\source\simgear\screen\texture.cxx(23) : fatal error C1083: Cannot open include file: 'zlib.h': No such file or directory
Searching shows it is in C:\FG0981\SimGear\source\src-libs\zlib-1.1.4, which means I need to add '.\src-libs\zlib-1.1.4' to the additional directories, replacing the faulty zlib entry there ...

The next F7 produces a big list off MISSING -
Compiling...
vec3fv.cpp - c1xx : fatal error C1083: Cannot open source file: '.\simgear\scene\sky\clouds3d\vec3fv.cpp': No such file or directory
tri.cpp - c1xx : fatal error C1083: Cannot open source file: '.\simgear\scene\sky\clouds3d\tri.cpp': No such file or directory
SkyUtil.cpp - c1xx : fatal error C1083: Cannot open source file: '.\simgear\scene\sky\clouds3d\SkyUtil.cpp': No such file or directory
SkyTextureState.cpp - c1xx : fatal error C1083: Cannot open source file: '.\simgear\scene\sky\clouds3d\SkyTextureState.cpp': No such file or directory
SkyTextureManager.cpp - c1xx : fatal error C1083: Cannot open source file: '.\simgear\scene\sky\clouds3d\SkyTextureManager.cpp': No such file or directory
SkySceneManager.cpp - c1xx : fatal error C1083: Cannot open source file: '.\simgear\scene\sky\clouds3d\SkySceneManager.cpp': No such file or directory
SkySceneLoader.cpp - c1xx : fatal error C1083: Cannot open source file: '.\simgear\scene\sky\clouds3d\SkySceneLoader.cpp': No such file or directory
SkyRenderableInstanceGroup.cpp - c1xx : fatal error C1083: Cannot open source file: '.\simgear\scene\sky\clouds3d\SkyRenderableInstanceGroup.cpp': No such file or directory
SkyRenderableInstanceCloud.cpp - c1xx : fatal error C1083: Cannot open source file: '.\simgear\scene\sky\clouds3d\SkyRenderableInstanceCloud.cpp': No such file or directory
SkyMinMaxBox.cpp - c1xx : fatal error C1083: Cannot open source file: '.\simgear\scene\sky\clouds3d\SkyMinMaxBox.cpp': No such file or directory
SkyMaterial.cpp - c1xx : fatal error C1083: Cannot open source file: '.\simgear\scene\sky\clouds3d\SkyMaterial.cpp': No such file or directory
SkyLight.cpp - c1xx : fatal error C1083: Cannot open source file: '.\simgear\scene\sky\clouds3d\SkyLight.cpp': No such file or directory
SkyDynamicTextureManager.cpp - c1xx : fatal error C1083: Cannot open source file: '.\simgear\scene\sky\clouds3d\SkyDynamicTextureManager.cpp': No such file or directory
SkyContext.cpp - c1xx : fatal error C1083: Cannot open source file: '.\simgear\scene\sky\clouds3d\SkyContext.cpp': No such file or directory
SkyCloud.cpp - c1xx : fatal error C1083: Cannot open source file: '.\simgear\scene\sky\clouds3d\SkyCloud.cpp': No such file or directory
SkyArchive.cpp - c1xx : fatal error C1083: Cannot open source file: '.\simgear\scene\sky\clouds3d\SkyArchive.cpp': No such file or directory
plane.cpp - c1xx : fatal error C1083: Cannot open source file: '.\simgear\scene\sky\clouds3d\plane.cpp': No such file or directory
minmaxbox.cpp - c1xx : fatal error C1083: Cannot open source file: '.\simgear\scene\sky\clouds3d\minmaxbox.cpp': No such file or directory
mat16fv.cpp - c1xx : fatal error C1083: Cannot open source file: '.\simgear\scene\sky\clouds3d\mat16fv.cpp': No such file or directory
glut_shapes.c - c1 : fatal error C1083: Cannot open source file: '.\simgear\scene\sky\clouds3d\glut_shapes.c': No such file or directory
camutils.cpp - c1xx : fatal error C1083: Cannot open source file: '.\simgear\scene\sky\clouds3d\camutils.cpp': No such file or directory
camera.cpp - c1xx : fatal error C1083: Cannot open source file: '.\simgear\scene\sky\clouds3d\camera.cpp': No such file or directory

This looks like the whole clouds3d has been remove, so I try removing the project component Lib_clouds3d ... This may bite me later, but want to get on with the compile ...

Still 2 warnings in string.c -
c:\FG0981\SimGear\source\simgear\nasal\string.c(214) : warning C4244: 'function' : conversion from 'double' to 'int', possible loss of data
c:\FG0981\SimGear\source\simgear\nasal\string.c(275) : warning C4244: 'function' : conversion from 'double' to 'int', possible loss of data

Assume that is what the programmer wanted - double to int - so ignored ...

More warnings in nasal.c -
c:\FG0981\SimGear\source\simgear\nasal\hash.c(37) : warning C4018: '<' : signed/unsigned mismatch
c:\FG0981\SimGear\source\simgear\nasal\hash.c(71) : warning C4018: '<' : signed/unsigned mismatch
c:\FG0981\SimGear\source\simgear\nasal\hash.c(176) : warning C4018: '<' : signed/unsigned mismatch
c:\FG0981\SimGear\source\simgear\nasal\hash.c(203) : warning C4018: '<' : signed/unsigned mismatch

Ignored for now ...

Another fatal error -
c1 : fatal error C1083: Cannot open source file: '.\simgear\nasal\debug.c': No such file or directory
Since no such file found in the copy of the CVS source, remove it when I find it ... in Lib_sgnasal ...

Just 3 more warnings -
c:\FG0981\SimGear\source\simgear\math\fastmath.cxx(99) : warning C4244: '=' : conversion from 'int' to 'float', possible loss of data
c:\FG0981\SimGear\source\simgear\math\fastmath.cxx(248) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
and
c:\fg0981\simgear\source\simgear\debug\logstream.hxx(204) : warning C4715: 'logbuf::overflow' : not all control paths return a value

all ignored for now ...

Eventually get to -
Build: 2 succeeded, 0 failed, 0 skipped
for the debug build. The 2 here refers to SimGear.lib and zlib.lib. Copy the Additional Include Directories over to the Release build ... and try it ..

Of course, the SimGear release gives the same warnings, as above -
SimGear - 0 error(s), 13 warning(s)
but the build completes -
Build: 2 succeeded, 0 failed, 0 skipped
and I now have 4 static libraries, 2 debug, 2 release, in their respective folders ... do a Save All, ready for the next project ...

FlightGear Build

Xcopy /E the FGCVS/source to FG0981/source, and locate the *.sln, or in this case the FlightGear.dsw, and load it into MSVC7 ... I get a warning dialog about conversion, on which I always click [Yes to All] ... why not?

Expanding the FlightGear project, I see a config.h-msvc6 at the end, but when I try to open it, it does NOT exist ... but there is a config.h-msvc6.in file ... I copy this to config.h in the same folder, C:\FG0981\FlightGear\source\src\Include ...

Checking the Properties, C++ tab, Runtime Library, the Debug correctly shows Multi-threaded Debug (/MTd), but so does the Release configuration - corrected it to just Multi-threaded (/MT). I am sure the Additional Include Directories is not going to be correct, with -
..,.\src,.\src\include,..\SimGear,..\SimGear\metakit-2.4.3\include,..\SimGear\zlib-1.1.4

I make some initial guesses, and correct the above to -
..\..,.\src,.\src\include,..\..\SimGear\source\simgear,..\..\SimGear\src-libs\zlib-1.1.4
but am sure this will not be enough ;=))

Of course, compiling the first file, TrafficMgr.cxx yields -
c:\FG0981\FlightGear\source\src\Traffic\TrafficMgr.cxx(46) : fatal error C1083: Cannot open include file: 'plib/sg.h': No such file or directory
What can be wrong here? I have already provided an additional path back two from the location of the DSW file, namely ..\.. - why no PLIB/sg.h found?

Checking the Properties, C++, Additional Include Directories show my replacement of the original string FAILED ... Did I forget to also click [Apply]? I replace it again, and the error moves on to the next -
c:\FG0981\FlightGear\source\src\Traffic\TrafficMgr.cxx(48) : fatal error C1083: Cannot open include file: 'simgear/compiler.h': No such file or directory
Ah, it includes simgear/compiler.h, thus I must remove the final simgear, after the source folder ... making sure I click [Apply], the [OK] to remove the properties dialog ...

The next is -
c:\FG0981\FlightGear\source\src\Main\globals.hxx(28) : fatal error C1083: Cannot open include file: 'config.h': No such file or directory
I can see my new config.h is in C:\FG0981\FlightGear\source\src\Include - be careful, there is another config.h in C:\FG0981\FlightGear\source\utils\fgadmin\src - I will have to learn what this is later ... so correct from .\src\include, to .\src\Include ... confused here - MSVC7 is not usually sensitive to path case??? But it now moves on ...

The Additional Include Directories now read -
..\..,.\src,.\src\Include,..\..\SimGear\source,..\..\SimGear\src-libs\zlib-1.1.4
and things begin to move on ...

Initially got lots of C4101 warnings -
c:\FG0981\FlightGear\source\src\Traffic\Schedule.cxx(343) : warning C4101: 'alt' : unreferenced local variable
c:\FG0981\FlightGear\source\src\Traffic\Schedule.cxx(408) : warning C4101: 'courseToUser' : unreferenced local variable
c:\FG0981\FlightGear\source\src\Traffic\Schedule.cxx(409) : warning C4101: 'distanceToUser' : unreferenced local variable
c:\FG0981\FlightGear\source\src\Traffic\Schedule.cxx(443) : warning C4101: 'elapsedTimeEnroute' : unreferenced local variable
c:\FG0981\FlightGear\source\src\Traffic\Schedule.cxx(442) : warning C4101: 'totalTimeEnroute' : unreferenced local variable
SchedFlight.cxx
c:\FG0981\FlightGear\source\src\Traffic\SchedFlight.cxx(149) : warning C4101: 'targetDate' : unreferenced local variable

but you learn to IGNORE this warning ...

The next fatal error is compiling moonpos.cxx -
c1xx : fatal error C1083: Cannot open source file: '.\src\Time\moonpos.cxx': No such file or directory
This is where read the development board comes in handy ... I remember others mentioning this error, and it seems moonpos.cxx is not longer needed ... so remove it from the build ... also the hxx file ...

More C4101 - unreferenced variables - ignored ... compiling morse.cxx produces the next - predictable, if I had thought deeper - fatal error -
c:\FG0981\SimGear\source\simgear\sound\soundmgr_openal.hxx(49) : fatal error C1083: Cannot open include file: 'AL/al.h': No such file or directory
Of course I have to provide and additional path to AL, so I add -
..\..\AL\include
to properties, C++, General, Additional Include Directories ...

Oops, forgot it partner ... added '..\..\AL\alut\include' ...

And oops again ... I though I had added a path to zlib.h, but apparently not ...
c:\FG0981\SimGear\source\simgear\misc\zfstream.hxx(33) : fatal error C1083: Cannot open include file: 'zlib.h': No such file or directory
The full search path is 'C:\FG0981\simgear\source\src-libs\zlib-1.1.4', and I had added '..\..\SimGear\src-libs\zlib-1.1.4', which should be '..\..\SimGear\source\src-libs\zlib-1.1.4' ... fix and continue ...

The full Additional Include Directories string is now -
..\..,.\src,.\src\Include,..\..\SimGear\source,..\..\SimGear\source\src-libs\zlib-1.1.4,..\..\AL\include,..\..\AL\alut\include
and am rewarded somewhat with a very long compile list ... but get to the LINK without another FATAL error ...
FlightGear - 4245 error(s), 193 warning(s)
Naturally I should review some of the warnings, but will attack the 4,245 errors first ;=)) Here is the massive Build Log in its entirety ;=() 900KB plus ...

Hopefully, most of these LINK errors are due to missing static libraries ... back into Properties, Linker tab, Input show only 1 Additional Dependency, namely wsock32.lib ... First lets add SimGear.lib, and each of the PLIB static libraries, and see what we get ... While it is nice, and neater, to ADD only the needed, used, static libraries, in this case I have simple done a dir on the PLIB folder, and added them ALL ... technically this should not harm, since, as I understand it, only code that is used is extracted from each of the libraries, so the present LIB list is -
ws2_32.lib Simgear.lib fnt_d.lib js_d.lib net_d.lib psl_d.lib puAux_d.lib pui_d.lib pw_d.lib sg_d.lib sl_d.lib ssgAux_d.lib ssg_d.lib ul_d.lib
Note, the '_d' for the debug build in am doing ... and note, this list appear to not work with a comma, nor semicolon separator ... JUST A SPACE !!!???!!!

This MASSIVELY reduce the errors -
FlightGear - 147 error(s), 1 warning(s)
but that continuing puzzle is for later ...

Ok, of course I need to add zlib.lib, and will try OpenAL32.lib, for the missing AL items ... produces another improvement -
FlightGear - 106 error(s), 1 warning(s)

Now I must get SERIOUS about the missing items ... like -
environment.obj : error LNK2019: unresolved external symbol "public: double __thiscall SGEnviro::get_cloud_turbulence(void)const " (?get_cloud_turbulence@SGEnviro@@QBENXZ) referenced in function "public: virtual double __thiscall FGEnvironment::get_turbulence_magnitude_norm(void)const " (?get_turbulence_magnitude_norm@FGEnvironment@@UBENXZ)
Where is this? Added visual_enviro.cxx to LIB_sgenvironment in SimGear ...

Added fgclouds.cxx and fgmetar.cxx to Lib_Environment in FlightGear ...

Added FGGroundCallback.cpp to Lib_JSBSim in FlightGear ... reduced 'missing' to -
FlightGear - 88 error(s), 1 warning(s)

Add LaunchBar.cpp to Lib_Yasim, in FlightGear ...

Add Hook.cpp to Lib_Yasim,. in FlightGear ... result -
FlightGear - 64 error(s), 12 warning(s)

Add FGGround.cpp to Lib_Yasim,. in FlightGear ... result, still -
FlightGear - 64 error(s), 1 warning(s)

Add Ground.cpp to Lib_Yasim,. in FlightGear ... result, still -
FlightGear - 61 error(s), 7 warning(s)

Add shadowvolume.cxx to Lib_sgmodel, in SimGear ...

Add fonts.cxx to Lib_GUI, in FlightGear ... reduced to -
FlightGear - 51 error(s), 1 warning(s)

Add tacan.cxx and od_gauge.cxx to Lib_Instrumentation, in FlightGear, and make the following FIX under _MSC_VER define -
#ifdef _MSC_VER
if ((frequency_khz > 9620) && (frequency_khz <= 12130))return frequency_khz/100;
#else // !_MSC_VER
if (frequency_khz >9620 and frequency_khz <= 12130)return frequency_khz/100;
#endif // _MSC_VER y/n
but up again in errors, with -
FlightGear - 55 error(s), 1 warning(s)

Add inst_vertical_speed_indicator.cxx to Lib_Instrumentation, in FlightGear ...

Add thread-win32.c to Lib_sgnasal, in SimGear ... down to -
FlightGear - 46 error(s), 1 warning(s)

Add newcloud.cxx, bbcache.cxx, cloudfield,cxx to Lib_sgsky, in SimGear ... yow, down to -
FlightGear - 26 error(s), 1 warning(s)

Add ALc.lib, ALu.lib and wrap_oal.lib to FlightGear, and add respective paths ...

Add shadanim.cxx to Lib_sgmodel, in SimGear

Add shader.cpp to Lib_sgscreen, in SimGear ...

Add AIStatic.cxx to Lib_AIModel, in FlightGear ... still -
FlightGear - 23 error(s), 1 warning(s)

Add RenderTexture.cpp to Lib_sgscreen, in SimGear ... nearly there -
FlightGear - 11 error(s), 1 warning(s)

Add placementtrans.cxx to Lib_sgmodel, in SimGear ...

Add wxRadar.cxx to Lib_Instrumentation, in FlightGear ...

Getting CLOSE, but some REAL TROUBLE with the following -
------ Build started: Project: FlightGear, Configuration: Debug Win32 ------
Linking...
LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
AIAircraft.obj : error LNK2019: unresolved external symbol "public: void __thiscall FGAIFlightPlan::create(class FGAirport *,class FGAirport *,int,double,double,double,double,bool,double,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?create@FGAIFlightPlan@@QAEXPAVFGAirport@@0HNNNN_NNV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@22@Z) referenced in function "public: void __thiscall FGAIAircraft::loadNextLeg(void)" (?loadNextLeg@FGAIAircraft@@QAEXXZ)
AIFlightPlan.obj : error LNK2001: unresolved external symbol "public: void __thiscall FGAIFlightPlan::create(class FGAirport *,class FGAirport *,int,double,double,double,double,bool,double,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?create@FGAIFlightPlan@@QAEXPAVFGAirport@@0HNNNN_NNV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@22@Z)
SimGear.lib(sample_openal.obj) : error LNK2019: unresolved external symbol __imp__alutUnloadWAV referenced in function "public: __thiscall SGSoundSample::SGSoundSample(char const *,char const *,bool)" (??0SGSoundSample@@QAE@PBD0_N@Z)
SimGear.lib(sample_openal.obj) : error LNK2019: unresolved external symbol __imp__alutLoadWAVFile referenced in function "public: __thiscall SGSoundSample::SGSoundSample(char const *,char const *,bool)" (??0SGSoundSample@@QAE@PBD0_N@Z)
.\Debug/FlightGear.exe : fatal error LNK1120: 3 unresolved externals
Build log was saved at "file://c:\Fg0981\FlightGear\source\Debug\BuildLog.htm"
FlightGear - 5 error(s), 1 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped

WHAT TO DO NEXT??? There are ONLY 3 unresolved. BUT WHERE TO FIND THEM??? Must sleep on it ...

The first TRIAL was to REMOVE sample_openal.cxx from Lib_sgsound, in SimGear, but this produces MORE missing items, and besides, this file is included in the appropriate Makefile.am, another good place to look for clues ...

When I add it back, the re-compiling of sample_openal.cxx produces some INTERESTING warnings. Ignoring the C4800 T/F thingy, we can see a C4996 - functions are declared 'depreciated' ... Maybe this is why they are NOT available in the current OpenAL libraries ...
c:\FG0981\SimGear\source\simgear\sound\sample_openal.cxx(63) : warning C4800: 'ALuint' : forcing value to bool 'true' or 'false' (performance warning)
c:\FG0981\SimGear\source\simgear\sound\sample_openal.cxx(111) : warning C4996: 'alutLoadWAVFile' was declared deprecated
c:\FG0981\AL\alut\include\AL\alut.h(98) : see declaration of 'alutLoadWAVFile'
c:\FG0981\SimGear\source\simgear\sound\sample_openal.cxx(124) : warning C4996: 'alutUnloadWAV' was declared deprecated
c:\FG0981\AL\alut\include\AL\alut.h(101) : see declaration of 'alutUnloadWAV'
c:\FG0981\SimGear\source\simgear\sound\sample_openal.cxx(175) : warning C4996: 'alutUnloadWAV' was declared deprecated
c:\FG0981\AL\alut\include\AL\alut.h(101) : see declaration of 'alutUnloadWAV'

First, looking at the OpenAL site - http://www.openal.org/ - for clues ... There is a mention, dated August 2005, that mentions a 'Windows SDK' ... These two functions ARE in a source file in the OpenAL CVS tree, but that source file is NOT included in the ALc, ALu, wrap_oal, nor OpenAL32 static libraries, that I have already included in the LINK ...

There is another MSVC7 solution (SLN) file, in the ALut/admin folder, but so far all attempts to compile this have failed, and it appears it is a DLL anyway ... the README in the ALUT/src folders says -
The files in this directory contain the code of the ALUT library. They typically
compile to make 'libalut.so' on *nix platforms or to 'alut.dll' for Windows
platforms.
Why do they shift to a DLL in Windows?

The Makefile.am in this same folder gives the sources as -
# libalut consists of the following sources and internal headers:
libalut_la_SOURCES = \
alutBufferData.c \
alutCodec.c \
alutError.c \
alutInit.c \
alutInputStream.c \
alutInternal.h \
alutLoader.c \
alutUtil.c \
alutVersion.c \
alutWaveform.c

9 'c' files, while the alut.vcproj files only lists -
Name="Source Files"
<File RelativePath="..\src\alutError.c"> </File>
<File RelativePath="..\src\alutInit.c"> </File>
<File RelativePath="..\src\alutLoader.c"> </File>
<File RelativePath="..\src\alutUtil.c"> </File>
<File RelativePath="..\src\alutVersion.c"> </File>
<File RelativePath="..\src\alutWaveform.c"> </File>

6 'c' files ... maybe that is why it will NOT compile in MSVC7?

Should I add - alutBufferData.c alutCodec.c alutInputStream.c and try to complete the alut.dll? Let's try anything at this stage ... this is really hacking, without the slightest clue ;=))

Yow, that worked! -
Creating library .\Debug/alut.lib and object .\Debug/alut.exp
alut - 0 error(s), 1 warning(s)

and the warning is only about edit and continue, versus no incremental conflict, so is not a warning at all ;=))
I NOW have an alut.dll, with its associated alut.lib ... do I want to continue the streak of good luck, and try for a static library ... why not?

Ok, that was easy. I have create an static library I have called aluts.lib ... will this solve my link problems in FlightGear? ... Probably, maybe ... but first I want to try to REMOVE some of the static libraries I added 'in haste' ... to see if there is an increase in the unresolved items ... NO, changed my mind on this ... later, when the link is complete, perhaps ...

No, the aluts.lib static library FAILED to resolve, since the alut.h header declares this as dllimports, thus they have the __imp__ lead, and are not resolved by my new static library ... but, ok, I now have a DLL, and its associated library, so should be able to include this in the link ...

Yippee, I am down to ONE (1) unresolved item -
Linking...
AIAircraft.obj : error LNK2019: unresolved external symbol "public: void __thiscall FGAIFlightPlan::create(class FGAirport *,class FGAirport *,int,double,double,double,double,bool,double,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?create@FGAIFlightPlan@@QAEXPAVFGAirport@@0HNNNN_NNV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@22@Z) referenced in function "public: void __thiscall FGAIAircraft::loadNextLeg(void)" (?loadNextLeg@FGAIAircraft@@QAEXXZ)
AIFlightPlan.obj : error LNK2001: unresolved external symbol "public: void __thiscall FGAIFlightPlan::create(class FGAirport *,class FGAirport *,int,double,double,double,double,bool,double,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?create@FGAIFlightPlan@@QAEXPAVFGAirport@@0HNNNN_NNV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@22@Z)
.\Debug/FlightGear.exe : fatal error LNK1120: 1 unresolved externals

This LOOKS like the definition, and the use are DIFFERENT ... how to fix that? Both reference the 'create' of a FGAIFlightPlan(...) ... there is a 'create' declared in AIFlightPlan.hxx -
void create(FGAirport *dep, FGAirport *arr, int leg, double alt, double speed, double lat, double lon, bool firstLeg, double radius, string fltType, string aircraftType, string airline);
BUT, there appears no implementation of this function???

I provide a null implementation ... just add {} before the semi-colon in the hxx ... and BINGO ... I am REWARDED WITH -
Build: 1 succeeded, 0 failed, 0 skipped
But this is a VERY BAD solution ... OF COURSE, the implementation is in a SEPARATE file ;=)) Just add AIFlightPlanCreate.cxx to Lib_AIModel ... and double bingo ... I get a complete LINK! PHEW!!!

To solve these missing items, I used a search tool, my own, FA4, (Find-All-v4), which is like grep ... By searching the source files for the missing function, and once found adding that source file to the build list, I achieved what I HOPE is the correct build list. But another method would be to read the many Makefile.am files in each source folder ... these clearly show what files should be added for each section. If I had the time and inclination, I should probably do such a check now ;=)) For example, reading Makefile.am in the AIModel folder would have shown me that I was missing AIFlightPlanCreate.cxx from the build list. There is a perl utility, which is sometimes run, which does this search, and writes a new FlightGear.DSP file ...

This is the DEBUG version ... now for the RELEASE version ... This means copying many of the properties from the Debug ... but it should be easy ;=)) Remembering to remove the '_d' from the PLIB static libraries, and in the other cases changing to the Release path to find the correct library ...

Just 8-9 minutes to compile and link ...

In preparation of my first run, I choose to also copy the FGCVS/FlightGear/data to FG0981/FlightGear/data ... of course I ensure my joystick - Microsoft Sidewinder is plugged in ;=)) And rather than typing on the command line, I prepare a batch file to run FG ... it contains -
source\Release\flightgear --fg-root=C:\FG0981\FlightGear\data --aircraft=c172p

Of course, I have forgotten to 'install' my alut.dll ... in Windows, a DLL is 'installed' if it is in one of the PATH environment folders ... in my case I copy the DLL to C:\MDOS, and old folder that I keep handy, always in my PATH ;=))

*** IT RUNS *** IT RUNS *** IT RUNS *** IT RUNS ***

I guess it has been at least SIX (6) months since I ran FlightGear ... It has one of the same 'features' now, as then ... I must try to FIX this someday! ... the joystick is initialised, but for some reason the throttle slider is NOT always commenced at ZERO ... there seems some residual value acquired, even though the slider is at zero on the joystick ... if I quickly move it up a little, then back to zero, the internal value is set to zero ...

But, what this often means on start up, is that by the time I get control, the plane has moved, usually to the left, and off the runway ... not a big problem, but sometimes annoying ...

And, as per my habit, I take the --aircraft out of the batch file, and add a system.fgfsrc file to the FlightGear/data root ... and then I put all my desired options in here ... below is the typical contents of my most recent system.fgfsrc file ... note lines beginning with '#' character are COMMENTS -
# system.fgfsrc
# set TIME
--timeofday=noon
--altitude=10000
#// Atlas.cxx - in FG to output ...
###--atlas=socket,out,5,<broadcast>,5500,udp

# set aircraft/FDM to run
--aircraft=ufo
###--fdm=magic
--fdm=ufo
###--fdm=para
###--fdm=yasim
###--aircraft=paraglider-jsbsim
###--aircraft=dhc2F
###--prop:/sim/panel/path=Aircraft/c172/Panels/c172-panel.xml
--prop:/sim/hud/draw-fps=true
# set airport - KSFO default
###--airport-id=25U
###--airport-id=YSSY
###--airport-id=YSDU
### uncommenting the nimitz_demo scenario tag from data/preferences.xml
### using latitude=37.688, longitude=-122.683 and heading=180 in
### data/Data/AI/nimitz_demo.xml
### and finally the commandline:
### fgfs --lat=37.689 --lon=-122.683 --altitude=72 --heading=180
### Ok, now you will be on the carrier.
###--lat=37.689
###--lon=-122.683

# log-level order = debug info warn alert
--log-level=info
#--log-level=debug
### causes problems
##--log-class=terrain|astro|flight|input|gl|view|cockpit|general|math|event|aircraft|autopilot|io|clipper|network|instrumentation|systems
##--log-class=terrain|astro|flight|input|gl|view|cockpit|general|math|aircraft|autopilot|io|clipper|network|instrumentation|systems

--enable-hud

# in metres
###--visibility=32000
--visibility=200000
###does not work? --visibility=-1

--control=joystick
--disable-random-objects
--disable-panel
--disable-ai-models
--disable-clouds
### no-no ??--disable-clouds3d
--disable-skyblend
--fog-disable
--disable-sound
#--disable-distance-attenuation

# EOF

I am ready for my next FLIGHT, this time in a UFO ...

Oops ... after a long list of things in the console window ... I love the new, helpful, loading statements below the flash screen ... these were not there last time ... FlightGear ABORTED ... the last few lines in the console window were -
...
token = OBJECT_BASE name = 958456.btg
token = OBJECT_SHARED name = Models/Structures/radio-medium.xml pos = -121.899,
37.8927 elevation = 964.9 heading = 0
Loading tile C:/FG0981/FlightGear/data/Scenery/Objects/w130n30/w122n37/958456
Unknown exception in the main loop. Aborting...
Possible cause: No error
Deleting a sample
Deleting a sample
Deleting a sample
Deleting a sample
Deleting a sample
and I was back at the CONSOLE prompt!!! UGH! What happened? ... try, changing the log level to debug ... just a quick adjustment in the system.fgfsrc file ...

*** AND IT WORKS ??? What went wrong on the previous? No idea, yet! Let me see if I can get a screen snapshot ...

 
This is at about 6,000 feet, looking over SF International toward Golden Gate Bridge
ABSOLUTELY BEAUTIFUL!

Using the File / Snapshot menu, it wrote a rather larger, 1.4MB ppm file, which I converted to a 37KB jpg, using XnView (http://www.xnview.com). The file was created in the runtime directory, where I created, and ran the batch file from ... You will note the modest 5.0 frames per second in the bottom left of the image ...

Naturally, with this raised log level, there are hundreds of messages flashing by on the console window ... But with UFO, I could fly around ... I head south, down the coast ... at maximum throttle ... about 3,800 knots indicated ... to find my current scenery tile boundary ... you know this when it all become water! ... the default action of FlightGear is to paint 'water' if it has no scenery ... I like to alter this to the red hatched tile paint ... I rather reluctantly exit FlightGear to perform this code change ... if I can remember exactly where it happens ... I think it is SimGear, somewhere ... No, will come back to this later ... if ever ;=))

So ends this story, from a fresh CVS update on October 12, to up and flying October 15 ... three days of quite hard work ... well play really ... not the whole day each time ... but a total of about 15-20 hours ... BUT IT IS WORTH THE EFFORT! ;=)) Try it yourself, or there are some compiled binaries that you can download ... but you must download the FlightGear scenery data ... start at http://flightgear.org/ ...

Also, the zip below may help. Take care. It uses the directory structure I have chosen ... and clicking the 'back' below will take you an index, which leads to other, earlier pages, on the building of FlightGear, and its dependencies, and other information and links ...

Enjoy it all, Geoff.

back

This msvc-1005.zip contains all the *.sln, and *.vcproj MSVC7 files used. Where there is no solution/project files, the older MSVC6 files, *.dsw and *.dsp, which can be loaded in MSVC7, have ALSO been included ... I can only hope this helps, not confuse ...

If you really want to follow some more, read on here ...