Sign in to follow this  
jcboliveira

What C++ Compilers can be used for creating Gauges?

Recommended Posts

Hi all,I Read in the Panel SDK tool kit, that one should use the Microsoft Visual C++ Compiler version 4.0 or higher.My questions is:Are any of you folks using other c++ compilers to develope FS2002 gauges? And if so, what are you guys/gals using?Thanks for any feedback.

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

the Free BorlandC++ compiler does wonders for me! as the most compliant ++ implementation, extremely fast to compile, very optimized code, stable and bug free:http://www.borland.com/products/downloads/index.htmland select in the menu: C++ builder. Then in the table, choose the v5.5 download (~8.7 MB).and for a C, C++ file editor and IDA, you can also use this:http://www.cs.virginia.edu/~lcc-win32/Hope this helps!

Share this post


Link to post
Share on other sites

JeanLuc....Thank you very much for your quick reponse. I assume the Borland package mentioned will work on ME ops. I shall download and installthe two items you provided in your answer.For years I had Borland C and C++ packages on old windoze machines,but those packages would not work correctly on my newer ME machine.I look forward to getting a C compiler for my ME machine.Thank you once more for your help.

Share this post


Link to post
Share on other sites

Additionaly the free mingw32 GNU C Compiler (GCC) also works. Get the last of the sd2gauxx.zip files from flightsim.com, it contains a lot of documentation and readymade gauges.h and makefiles compatible to VC,GCC,BCC.Arne Bartels

Share this post


Link to post
Share on other sites

Arne,Thank you for your quick reponse. Question. Can you provide ahyperlink to where I can download the "mingw32 GNU C compiler"?I am currently in the process of downloading the compiler suggested by JeanLuc. And also figure on following up on downloading the second suggested package he mentioned. WOW from not having any C compilers on my ME windoze machine to having three! Feast or famine!Thanks

Share this post


Link to post
Share on other sites

BorlandC is a command line compiler. So it is a windows console program (runs in a "dos window" visually). It runs on every Windows OS then. The advantage of BorlandC in my opinion is that it compiles very fast. As an example, the full Meridian gauges compiles in about 6 sec on a P4 1.3 with max optimisations and no pre compiled headers... :-) This includes compile + link (pre compiled ressources of course in this case). This allow to quickly change a couple lines during dev (to test something), compile, load the aircraft, check etc... From analyzing the output, I can tell you it is highly optimized even for v5.5 geared at PII CPUs. You can help the optimizations yourself in arraging your C code and sometimes doing "low level" C code to get the most benefit of modern CPU pipeline architecture without a compiler which handles this directly. Note that v5.5 knows about U anv V pipes. This includes avoinding CPU stalls and and forcing the CPU to pre fetch the data cache when heavy memory code has to run (without using special opcodes in __asm statements).I've experienced the GNU C compiler back on UNIX systems and Amiga. It is quite good too and does a very good job at optimisations. I remember an old comparision (well 3 years old) where the GNU and BCC were above VC for optimization. I would guess though that VC7 is the most advanced of all 3 now but it is not free.Hope this helps!

Share this post


Link to post
Share on other sites

Doug,Thank you for the compiler reference. After downloading the Borland and LCC compilers mentioned by JeanLuc I think I will stick with them for the time being. I must put on my thinking cap....been a few years since I had done any C programming. But thanks for the help.JeanLuc,UNIX ha. Love it. Linux. Love it. Windoze.......well at least it has provided endless hours of flying planes ever since the original Jet Fighter II game by Velocity came along back when all we had where25 mhz 386 machines and then Aces of the South Pacific! Still miss that one. Thanks for your further information regarding the Borland compiler.I downloaded it and the one from Virginia Tech you mentioned. Now all I have to do is try to think a bit! Been a while. I used to have the Borland Turbo and Borland C++ versions 3.0 (yea, tis beenyears), installed on old windoze machines I scrapped after they went caput. So I know where you are coming from. I sold more then one person on using the Borland compilers verse the earlier MS compilers, due to the very type things you have indicated.While I got your attention people..............Can someone answer this question for me. Could one make a standalone xml gauge that would produce a sonic boom?That is...........does xml gauge (the language) have the capabilities to to do what I believe is called a "CALLBACK" that would then load the appropritate wav file.......once the aircraft exceeded MACH 1?As you can see by my question, this is all quite new to me. I obviously must wade through the available documentation which of course would include what Arne Bartels had produced.take care,George

Share this post


Link to post
Share on other sites

You know that there is no sonic boom to be heard indside an aircraft? It's an effect that only appears outside the aircraft. Inside you notice probably a certain rise of the vibration level on passing Mach 1, but no boom.Arne Bartels

Share this post


Link to post
Share on other sites

>You know that there is no sonic boom to be heard indside an>aircraft? It's an effect that only appears outside the>aircraft. .>Arne Bartels True. But it would be nice to hear the boom when a supersonic AC flew by. The sound should be delayed. If one knows the distance and direction of travel then he could calculate the Mach Cone angle and figure when it hits a specific point.RAF

Share this post


Link to post
Share on other sites

Generaly speaking yes. The best tool in my opinion for this is this one:http://home.t-online.de/home/Ollydbg/Very user friendly and a lot of powerfull functions.Now, specificaly for FS2004, since their new protection system you can no longer run a debugger alongside FS2004. You have to find a way to run FS2004 without its CD...Hope this helps!

Share this post


Link to post
Share on other sites

Hi,kinda off-topic question I have here. Say I have the code of the gauge ready, how dou I create the .gau file then? I mean, the BCC compiler outputs only an .exe file from the .cpp file. How do I get the .gau file? This question is actually the one that kept me from starting to make gauges for flightsim.Thanks,Steven

Share this post


Link to post
Share on other sites

Arne,Understand. I was afraid someone would bring that up. But as Ron indicated, it could be interesting to hear a boom from a aircraft passing by which has just exceeded MACH 1 and perhaps if theplane was really close as it passes by (head on for instance just infront of one) .....have a boom and perhaps joggle the flyers aircraft about a bit. And as Ron indicated, instead of a boom in the cockpit,have the aircraft you are flying vibrate a bit. Of course as I understand it, not sure which ones do and which ones don't....new generation fighters probably give no indication that one had exceededMACH 1. One reason why I thought it would be nice to at least attempt makinga sonic boom is that the one implemented in a few new fighter releases, I believe one is the F35 model I downloaded here, is thatit was not programmed correctly to provide the sound when the mach meter shows 1 or transists through 1.............it always seemed to go boom at a given air speed, around 650knots or so, regardless of altitude, barametric pressure etc.. So I thought it would be a challenge to try to make a bang based on more realistic conditions.Ron,Not sure how to answer your question about the Borland 5.5 compileras far as debugging features go.After downloading it and installing it, and then setting up some configure files such as to point to where libs/include directories are...........................all I had time to do is create a quick "hello world" source code file then compile it. I have not had time to start digging into how to use the compiler.But there are debugger options one can use within the command line.These are standard features found in most c/c++ compilers. Perhaps JeanLuc can better describe just what can be done with the degug features particular to the Borland 5.5 compiler goes.Just so you are aware, when I tried to download the Borland compilerat site mentioned by JeanLuc, I had to provide a lot of personal info. So if you would rather not give phone number, address etc., don't bother trying to download it.Lastly, if you are looking for a free C/C++ Compiler ....perhaps the second site JeanLuc references in this thread would be a better choice, it has a IDE interface (integrated development environment) and of course a fully functional menu driven window system, so it, once one learns how to use the windows front end, provides a way for new programmers to C/C++ an enhanced way to start programming. You can for instance create different user projects resource files that can be "fined tuned" to your needs for a given type program. And the documentation looks pretty good. The site mentioned provides you with a number of things to download, including user manuals, MSWindowAPI (application interface) help files. Each module can be downloaded and installed seperatly. In short I would recommend thispackage for any starting C programmer. The Borland package though it probably is superior in compile time/link time etc., is a command line only compiler. Some people just work better in a window driven type environment, as apposed to typing long lines of command options etc..In either case, I think either of these compilers would serve your needs should you be ready to take the plunge into C programmingbest regards all,

Share this post


Link to post
Share on other sites

You can compile (without linking usually "bcc -c ...") and link to a dll (gau) in a second step manually. But it is much better to use the makefile method ("make..") for this purpose. You find examples in the tutorial I mentioned before.Arne Bartels

Share this post


Link to post
Share on other sites

Steven,Firstly, if I give an in-adequate answer, do ask it in a new thread to get a better answer.I would start to by saying, if you do not already have the MicrosoftSDK tool kit for Panel development download it. I would include the hyperline here but do not have the address on hand, ask it within a new thread for a quick response. In that SDK Tool Kit, you will find documentation as how to code a gauge file (one that ends with a ".gau"), create gauges (the visible gauge that you place into a panel), and at the end of the one document in that kit, read up on the information regarding how to create xml type gauges.Now I think I understand what your question is...............The gauges are nothing more then a dynamic object link library piece of code. In the windoze world we reference such files with an file extention called ".dll". But ...........and I am not sure at this point, since it is all new to me................I think when one compiles the source code, and gives it the options to compile as a dynamicd link library AS APPOSED TO A STANDALONE EXECUTABLE (file.exe), YOU in the compiler, ask it to call the output (compiled file) "my_gauge.gau". So in essence the my_gauge.gau file is nothing more then a non-linked object file, e.g. my_guage.obj in typicalC programming terms.Now.........I made the above statements on the fly. I two must sit down and read the SDK Panel Development documentation. I just started with all this stuff, so have limited knowledge. I had the Panel SDK on my machine for a few years but never got into this stuff, that is why I forget where I had downloaded it from at the official Microsoft Site.But I hope my explaination was at least partially adequate.

Share this post


Link to post
Share on other sites

Hi,well I have learned this year at school Java (first real programming language I learned). I think a DLL (or .gau) is something as a .jar file in the Java-world. I have read the SDK you are referring to some months ago, and I think I still have it on my pc. I'll start reading it again, maybe now some things or more clearer. The question I still have, is: is it sufficient to tell the output must be named file.gau? Probably not, and I think there should be some statements in the code that say the code forms a .gau file. I'm sure I'll find this information in the SDK. About the sonic boom gauge. It's quite interesting to hear the sonic boom. But how will the gauge be used? If it isn't possible to hear the boom inside the aircraft, then the sound may only be used in spot view or tower view. I don't know if it is actually possible to get the data to calculate the position of the viewpoint then, perhaps tower view.Anyway, I believe I have some tutorials to read :-)Thanks for the replies Arne and grb.Steven

Share this post


Link to post
Share on other sites

Arne,------------------------Thanks for the feedback on make. I am looking for some tutorials I created a few years ago that give some good examples of how to create and use make files (in the UNIX/Linux world) but the stuff would be applicable for anyone here just getting started with c programming.As I gather things that can help people I will create new threads on those things. I went to the Flightsimmer site as you recommended and looked for "sd2gauxx.zip as you recommended. Did not find anything. Then didsearches on "sd2*", etc. with no results. Looks like they dropped that zip file from the download dirs. But when I did a search for"sdk"................I found a zip file you authored titled sdkbug.zipwhich I downloaded to examine.----------------------------------------------Steven,Based on your last comments, It appears that you do not have a background in C programming. Therefore unless you really want to start from scratch, learn C/C++ to some degree, then learn how libraries and included Header files (file_name.h) etc., etc., areneeded to do anything in C worth while. Then I would suggest younot get to involved in this stuff. I am not trying to turn you off!I am simply making a clear statement that there is quite a bit you will have to learn about c programming and all the things that go with it that involve how one sets up a compiler etc., to make it do anything usefull, that you may become very frustrated or worse.However, if you want to learn C by all means do so. Download one of the compilers found in this thread JeanLuc, Arne, and another individual referenced, sorry other guy I only saw your name briefly in the thread ............where you suggested where to go for the mingc compiler, then start learning basic C programming. Thenas you get experienced in how to create code, and use compiler options and in the case of Window Driven Front Ends that allow youto create source, compile and link object files etc., set up resourcefiles, and projects, blah ....blah, you will reach a point whereyou can consider scratch building a guage by using the C programming language. I am saying these things to save you a lot of time at attempting to do something that is quite a bit more involved then one may think. You cannot design a gauge for use with FS2002 etc., if you are not totally familiar with compilation techniques and what libraries of files etc., go where and how they are used by the compiler AND OR the MAKE.EXE (MAKEK FILE GENERATOR) that is oftenused by programmers to create link objects and executables etc..In short, it will required a learning curve to get to the point where you can attempt to compile a source file that will create a guage,"gauge_name.gau".Lastly, as you read through the Panel SDK documentation and browse through the directories in that tool kit you will see a file called make. If you open it up with an editor you will find a statement inthat file titled "GOAL:". Then to the right of this token you will see "sdk.gua". This is the name assigned to in their case,a guage that contains a number of different gauges.In essence, this file "sdk.gua" is a dynamic link library file (dll) based on how the MAKE File tells the c compiler (in that example the compiler is called "cl" .....how to compile and link a lot of stuff including the original source file, with the end result being the "sdk.gua" piece of code............THAT is loaded into memory by the Simulator along with all the other gauge's dlls (*.gau) and other stuff that control the aircraft in the simulator.Whew. I hope you have followed the above somewhat. And I hope you can make a decision to learn C. Not for the sake of making gauges but for the endless hours of fun, it can lead you into.Sorry everyone for the rather verbose text. But I sense some folks may need at least a "hint" as what is involved in creating a gauge using the C programming language, and the SDK tool kit files that must be used in order to create a guage. The learning curve may be simply to much for many. As for XML gauges that can be used as is...perhaps there is some useful things some of us can learn how to do.I am a complete newbie to all things related to gauge development.So I will not comment further.best regards all,George

Share this post


Link to post
Share on other sites

Yes a GAU file is simply a windows DLL. As with any DLL, to make it loadable / workable, you need to add a stub. With all compiler the stub is a pre compiled lib (a collection of compiled source - .OBJ files).With Borland you just need to build a makefile, than call "make" !! Here is a typical makefile file I use with all the "good" (well the ones I want) options to produce a gauge. Just type "make" to compile, "make fs" to tranfer the compile gauge to the FS gauge dir. You can add any command in th makefile! (this is just an example). NB: $(GAU_NAME)_more_res.rc is an additional ressource file. The v5.5 has a limitation for which a compiled ressource file can't exceed 1MB. So you split your ressources in different files (.rc) and add their filename in the appropriate places in the makefile.I've forgotten to add: I've first started building gauges with the LCC Win32 compiler (the one with the IDA), but I never obtained a working gauge file, so the BCC gives me plenty of satisfaction! the file editor of LCC is really good (most of the modern features are included, like function parameters while you type in a popup tooltip, fast F1 help on the Windows and C API, list of functions, bookmarks, etc....). The code produced though is far from efficient, but enough for a standard windows app. There are also licensing restrictions with LCC which are not found with BCC.Last but not least ( I preach for my choir), but if you feel ready to install and configure GNU C (and derivatives), then you'll enjoy as much BCC and it may even be simpler with BCC than with GNU C.Here is the typical makefile file:GAU_NAME=MYGAUNAMEADD_LIBS=ADD_OBJS=my_additional_object.objADD_DEPS=gauges2k2.hADD_RESS=# RTL, startup module and module definition file for the linkerrtl=IMPORT32.LIB cw32mt.lib uuid.libinit_module=c0d32x.objdeffile=gauges_bcc.defGAU_OBJS=$(GAU_NAME).obj $(ADD_OBJS)GAU_RESS=$(GAU_NAME)_more_res.res $(GAU_NAME).res $(ADD_RESS)GAU_LIBS=$(ADD_LIBS)GAU_DEPS=$(GAU_NAME).c $(GAU_NAME).h Makefile $(ADD_DEPS)RES_DEPS=$(GAU_NAME).rc $(GAU_NAME).h Makefile# the compilers and the linker with their optionsCC=bcc32CFLAGS=-O2 -w-par -q -5 -Oc -OS -Ov -tWD -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 -Oi -RT- -v- -x- -xfCPP=cpp32CPPFLAGS=-qLD=ilink32LDFLAGS=/Tpd /c /C /Gn /x /q /GprRC=brcc32RCFLAGS=# link the gauge$(GAU_NAME).gau: $(GAU_OBJS) $(GAU_LIBS) $(GAU_RESS) $(LD) $(LDFLAGS) $(init_module) $(GAU_OBJS), $@,,$(GAU_LIBS) $(rtl) ,$(deffile),$(GAU_RESS)# compile the gauge$(GAU_NAME).obj: $(GAU_DEPS) $(CC) $(CFLAGS) -c $(GAU_NAME).c# build the resource file$(GAU_NAME).res: $(RES_DEPS) $(CPP) $(CPPFLAGS) -otmp.rc $(GAU_NAME)_more_res.rc $(GAU_NAME).rc $(RC) $(RCFLAGS) -fo $(GAU_NAME).res tmp.rc del tmp.rcclean: del *.res del *.objfs: move MYGAUNAME.gau "E:FS9GAUGESmy_gauge.gau" del *.tds del *.obj

Share this post


Link to post
Share on other sites

sd2gau14.zip at flightsim.com. Alternatevly search for "Dragonflight".Arne Bartels

Share this post


Link to post
Share on other sites

Thanks Georges,I know C isn't easy, certainly not for someone object oriented like me :-). In July I started to search for some tutorials on C++, but did not find anything that went much further than the Hello World example. Another thing that disturbs me is the fact that I can not find a site like http://java.sun.com where almost everything is explained that one can do with C++ without the need of coding a lot of lowlevel things myself. Guess I'll try to read some of the tutorials available here on Avsim and FlightSim.com for the flightsim stuff!Thanks guys,Steven

Share this post


Link to post
Share on other sites

IN ORDER FROM LATEST THREAD ENTRIES:Arne, Thanks for the feedback search for your guage file stuff.JeanLuc, Thanks for the detailed Makefile stuff. I shall examineit closely and then most probably use it. Steven, May I suggest that you get some books from your library, or school on C programming. Or try to find someone, who can give you some C user manuals etc.. Then if you are still biting.....download the free Borland Compiler package JeanLuc referenced in this thread.I assume your windoze system is set up so that you can run a DOS Window from the desktop or otherwise. You will have to be able to run DOS in a window to work with the Borland Compiler stuff.If anything. The compiler is free, and it is a good compiler. I used earlier verions both the DOS command line version as well as a very good Window driven version years back. This version is fullycompliant with W95/W98/WME/NT/W2000 ...... so all you need is tobe able to call up a DOS window from your desktop or running it fromthe START MENU/RUN window.I don't know what area of the globe you live in, but I am sure thatif you have access to book stores etc., you can find books with included CDROMs on C/C++. Think of it as a long term project. Do remember that most if not all Object Oriented Applications/programs etc., where developed using C and C++ language.The C language is really the premier language system to create objec oriented apps. Heck, Java was created using C. All your modern operating systems are created using C/C++ and sometimes associated Assembler packages. In short, C is used as the basis for much of what you see on PC, mainframes, minicomputers etc in the past twentyyears plus. As good as it is, Pascal for instance, a choice for years by Chemist for instance, simply cannot compete in the variety of ways the Cprogramming language is used. You mentioned learning Java. Well,what you picked up there will help you in C, because the syntax and contructs are similiar in both languages since Java was created using C. If you decide to go through with it. Ask me or others to direct you to sites that contain full tutorials on C/C++. There are a number of them out there. But there is nothing like having a book in front of you that you can wade through while you are attempting to write code.hang in there,George

Share this post


Link to post
Share on other sites

George, I already have the Borland compiler :-). I completely agree with what you stated in your last post :-). In a week, I'm back at my university in Leuven , Belgium(, Europe). Then I have access to the internet with my own pc, which is way easier to learn something than without it. (This pc is not mine, but my dads :-S). I'll search the library here for some books, but sites would be a lot easier. No penalties for bringing books back too late :-). So any URLs would be greatly appreciated.Thanks guys,Steven

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this