No success yet and am still playing.
Ivan,
Attached is a 'makefile' which should compile the FS98 SDK's 'control surface (and pitch trim) position indicator' gauge ('SDK.Control_Surfaces.*'), or any other gauge in that SDK -- I just chose that one at random. I've just now successfully built that gauge under the latest version of MinGW (
described in greater detail here) using the files straight from the FS98 SDK, with only one minor change in one of the SDK source files (see below).
Even better... I've also tested that FS98-era SDK sample gauge in CFS1 (and CFS2) and it works fine.
The 'gauges.h' file that I used is the unmodified file from the FS98 SDK, simply copied into the same directory as the SDK source code, for convenience.
The MinGW-compatible 'makefile' I've attached is from the well-known 'sd2gau' C-language gauge creation tutorial by Dai Griffiths. (Look for 'sd2gau31.zip' if you haven't gotten that yet -- it's a very good introduction to C-language gauge creation.) I've made 5 very minor changes to Dai's example MinGW makefile to make it work. Dai's makefile is rather different from the makefiles I use for MinGW gauge compilation, but I wanted to use something that was generally available to anyone reading this (now or in the future) who's looking to build FS98 or CFS1 (or even CFS2) gauges.
Aside: Frankly, I suspect that my modified version of Dai's makefile would still work on everything since FS98, with the proviso that the proper 'gauges.h' file was used based on the targeted version of the simulator (FS98, CFS1, FS2000, CFS2, FS2002, CFS3, FS2004, FSX -- I think that's the proper chronological order!). But I've only actually loaded/tested the compiled FS98 sample gauge on CFS1 and CFS2.
As for the change to that SDK source file, it was needed to work around what looked like an ugly hack by Microsoft for their C compiler. In fact, the comment in the offending area says "magic to get the preprocessor to do what we want". Here is the (trivial) change to be made:
In file 'SDK.Control_Surfaces.h', change this line:
Code:
#define cat3(w,x,z) w##.##x##.##z##\000
To this:
Code:
#define cat3(w,x,z) w##.##x##.##z
Now, as you know, your compilation of a more complex gauge than the FS98 SDK 'Control Surfaces' gauge will almost certainly lead to other issues to be solved, but I can see that you're well on the way to dealing with those and I don't expect you'll have too many unsolvable issues given your C experience.
BTW, what gauge are you trying to compile with MinGW? You've talked about the C-182 gauges, presumably from FS98, but I don't think there was ever any published source code for those gauges, was there? If you're using Bruce Hellstrom's GaugeDump ('GAUGEDMP.EXE') utility to extract the source, I think you'll run into the issue that (IIUC, I've never actually used it) his utility only creates C source code for the
elements of the gauge, leaving you to fill in the gauge handling (etc) C code.
I hope this makefile for MinGW gets you on the right track, so that you can at least get something that compiles and runs under CFS1 (and FS98, although I didn't test it under FS98).
Good luck and let us know if you need more help....
Regards,
Jester