[Flightgear-devel] ANSI C++ fixes; Compiling with G++ 3.x
I've committed made four small ANSI C++ fixes to the CVS to allow FlightGear to compile with G++ 3.0.3. I'd appreciate it if porters could confirm that the changes don't break any legacy compilers. I think it's generally a good thing for developers to use G++ 3.x, since it is very picky about ANSI C++ conformance and will catch errors that might trip up ports to other platforms (such as sloppy use of the std:: namespace). The downside is that G++ 3.x uses different C++ name mangling than G++ 2.95, so you have to recompile any C++ (but not C) libraries you're using. To ensure that you're using G** 3.x, set the CC and CXX environment variables in you ~/.bash_profile (or wherever): export CC=gcc-3.0 export CXX=gxx-3.0 Do that *before* you run configure. For FlightGear, you have to recompile plib, Metakit, and SimGear (in more-or-less that order) before you recompile FlightGear. Do at least a make clean; rm -f config.cache; configure on each one first (making sure that CC and CXX are set as above first). All the best, David -- David Megginson [EMAIL PROTECTED] ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
RE: [Flightgear-devel] Problems with JSBSim under Win32
This is old problem in JSBSim, but it has such fatal implications on executables compiled using MSVS only. Probably therefore nobody didn't try find it yet.. Try do next in FGInitialCondition.cxx to run it: bool FGInitialCondition::solve(float *y,float x) { float x1,x2,x3,f1,f2,f3,d,d0; float eps=1E-5; float const relax =0.9; int i; bool success=false; //initializations d=1; x1=xlo;x3=xhi; f1=(this-*sfunc)(x1)-x; f3=(this-*sfunc)(x3)-x; // ADD THIS CODE TO AVOID DIVISION BY 0 HERE if (f3-f1 == 0.0) f3+= 0.001; // END . . . This is not a real fix of sorce of this problem only avoiding of problem consequences, but it can temporary help you run FlightGear till it will be solved... Richard Kis -Original Message- From: Kaiser Georg [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 10, 2002 2:26 PM To: [EMAIL PROTECTED] Subject: [Flightgear-devel] Problems with JSBSim under Win32 After initialization of the JSB-FDM and tying properties to the FGInterface the location (lon, lat, alt, ...) is lost (values are 1.#QNAN) so that FG runs into that: // schedule a needed buckets for loading void FGTileMgr::schedule_needed() { // sanity check (unfortunately needed!) if ( longitude -180.0 || longitude 180.0 || latitude -90.0 || latitude 90.0 ) { SG_LOG( SG_TERRAIN, SG_ALERT, Attempting to schedule tiles for bogus latitude and ); SG_LOG( SG_TERRAIN, SG_ALERT, longitude. This is a FATAL error. Exiting! ); exit(-1); } This happens right after the call of fgTie( prop-path, pInterface, pGetter, pSetter ). The source is from cvs (yesterday) and I didn't change anything within nor in the base-package. Does anybody know the reason for that? Thanks Georg Kaiser ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] Re: ANSI C++ fixes; Compiling with G++ 3.x
David Megginson [EMAIL PROTECTED] writes: I've committed made four small ANSI C++ fixes to the CVS to allow FlightGear to compile with G++ 3.0.3. I'd appreciate it if porters could confirm that the changes don't break any legacy compilers. this breaks compiling with gcc 2.95.4. i get the following error (on a debian system running unstable): g++ -DFGFS -I. -I. -I../../../src/Include -I../../../src -I/usr/local/include -I/usr/X11R6/include -g -O2 -c -o FGTable.o `test -f FGTable.cpp || echo './'`FGTable.cpp FGTable.cpp: In method `void FGTable::Print()': FGTable.cpp:228: `ios_base' undeclared (first use this function) FGTable.cpp:228: (Each undeclared identifier is reported only once FGTable.cpp:228: for each function it appears in.) FGTable.cpp:228: parse error before `::' --alex-- -- | I believe the moment is at hand when, by a paranoiac and active | | advance of the mind, it will be possible (simultaneously with | | automatism and other passive states) to systematize confusion | | and thus to help to discredit completely the world of reality. | ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Problems with JSBSim under Win32
On Thu, 2002-01-10 at 15:08, Geoff McLane wrote: re: AVOID #QNAN ... old problem in JSBSim, but ... MSVS only. Probably few searchers = therefore nobody ... well a few ... slowly ... I changed FGAuxilary.cpp in the following - // Compare [d:\fg78cvs\flightgear\src\FDM\JSBSim\FGAuxiliary.cpp] // Size: 9,166 25/12/01 09:01 // With[d:\fg78\flightgear\src\FDM\JSBSim\FGAuxiliary.cpp] // Size: 9,172 01/01/02 12:21 // Time: Left is EARLIER - CHECK! = 167 ! double psiw,vw,psi; 167 ! double psiw,dvw,psi; = 171 ! vw = Atmosphere-GetWindNED().Magnitude(); 171 ! dvw = Atmosphere-GetWindNED().Magnitude(); = 173 ! return vw*cos(psiw - psi); 173 ! return dvw*cos(psiw - psi); = 180 ! double psiw,vw,psi; 180 ! double psiw,dvw,psi; = 184 ! vw = Atmosphere-GetWindNED().Magnitude(); 184 ! dvw = Atmosphere-GetWindNED().Magnitude(); = 186 ! return vw*sin(psiw - psi); 186 ! return dvw*sin(psiw - psi); Since vw is such an important global variable, I did not want a search for it to yield local incantations ... Uhmm... what problem were you having with this, there shouldn't be any name clashes here. (There is only one global variable in JSBSim: debug_lvl) I 'fixed' FGInitialCondition.cxx with - replace simple ! x2 = x1-d*d0*f1/(f3-f1); with do not directly derive x2, but check if divis zero first == very defensive coding = should NOT be required ! if( (f3 - f1) 0.0 ) !x2 = x1-d*d0*f1/(f3-f1); // zero checked ! else !x2 = x1-d*d0*f1/1.0;// do least damage in error cond. Thanks Richard (Kis), alias Georg Kaiser for your input, but 'we' :-? still search the answer ... as you said - lost (values are 1.#QNAN) ... FG runs into that ... and 'boom' ... rgds, Geoff. ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel -- Tony Peden [EMAIL PROTECTED] We all know Linux is great ... it does infinite loops in 5 seconds. -- attributed to Linus Torvalds ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] Compile error latest CVS
Latest CVS build dies with following error make[4]: Entering directory `/home/j4strngs/Repository/FlightGear/src/FDM/JSBSim' c++ -DFGFS -I../../.. -I../../../src -I/usr/local/include -I/usr/X11R6/include -g -O2 -c FGTable.cpp FGTable.cpp: In method `void FGTable::Print()': FGTable.cpp:228: `ios_base' undeclared (first use this function) FGTable.cpp:228: (Each undeclared identifier is reported only once FGTable.cpp:228: for each function it appears in.) FGTable.cpp:228: parse error before `::' make[4]: *** [FGTable.o] Error 1 ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
RE: [Flightgear-devel] Re: ANSI C++ fixes; Compiling with G++ 3.x
I've committed made four small ANSI C++ fixes to the CVS to allow FlightGear to compile with G++ 3.0.3. I'd appreciate it if porters could confirm that the changes don't break any legacy compilers. this breaks compiling with gcc 2.95.4. i get the following error (on a debian system running unstable): g++ -DFGFS -I. -I. -I../../../src/Include -I../../../src -I/usr/local/include -I/usr/X11R6/include -g -O2 -c -o FGTable.o `test -f FGTable.cpp || echo './'`FGTable.cpp FGTable.cpp: In method `void FGTable::Print()': FGTable.cpp:228: `ios_base' undeclared (first use this function) FGTable.cpp:228: (Each undeclared identifier is reported only once FGTable.cpp:228: for each function it appears in.) FGTable.cpp:228: parse error before `::' This same error occurs using the latest Cygwin on Win2000. Paul Paul R. Deppe Veridian Engineering (formerly Calspan) Flight Aerospace Research Group 150 North Airport Drive Buffalo, NY 14225 (716) 631-6898 (716) 631-6990 FAX [EMAIL PROTECTED] ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Compile error latest CVS
John Check wrote: Latest CVS build dies with following error make[4]: Entering directory `/home/j4strngs/Repository/FlightGear/src/FDM/JSBSim' c++ -DFGFS -I../../.. -I../../../src -I/usr/local/include -I/usr/X11R6/include -g -O2 -c FGTable.cpp FGTable.cpp: In method `void FGTable::Print()': FGTable.cpp:228: `ios_base' undeclared (first use this function) FGTable.cpp:228: (Each undeclared identifier is reported only once FGTable.cpp:228: for each function it appears in.) FGTable.cpp:228: parse error before `::' make[4]: *** [FGTable.o] Error 1 g++ 2.95.x lacks the Standard's ios_base class. One messy work around is demonstrated in simgear/misc/zfstream.hxx. FWIW I've been working on an alternative solution using namespaces that is much cleaner. It compiles with gcc 2.95.x and 3.0.x, Intel C++ and MSVC6. Another alternative is that the offending code can be rewritten slightly more portably using cout.flags() and/or cout.unsetf() though I haven't fully investigated this. Cheers, Bernie ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
RE: [Flightgear-devel] Re: ANSI C++ fixes; Compiling with G++ 3.x
Paul Deppe writes: This same error occurs using the latest Cygwin on Win2000. Is that based on G++ 2.95 or G++ 3.0? All the best, David -- David Megginson [EMAIL PROTECTED] ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
re: [Flightgear-devel] Compile error latest CVS
John Check writes: Latest CVS build dies with following error make[4]: Entering directory `/home/j4strngs/Repository/FlightGear/src/FDM/JSBSim' c++ -DFGFS -I../../.. -I../../../src -I/usr/local/include -I/usr/X11R6/include -g -O2 -c FGTable.cpp FGTable.cpp: In method `void FGTable::Print()': FGTable.cpp:228: `ios_base' undeclared (first use this function) FGTable.cpp:228: (Each undeclared identifier is reported only once FGTable.cpp:228: for each function it appears in.) FGTable.cpp:228: parse error before `::' make[4]: *** [FGTable.o] Error 1 Thanks -- I'll fix that tomorrow, if people don't mind waiting. It's an ANSI/non-ANSI C++ thing. All the best, David -- David Megginson [EMAIL PROTECTED] ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
RE: [Flightgear-devel] Compile error latest CVS
Bernie Bright writes: John Check wrote: Latest CVS build dies with following error make[4]: Entering directory `/home/j4strngs/Repository/FlightGear/src/FDM/JSBSim' c++ -DFGFS -I../../.. -I../../../src -I/usr/local/include -I/usr/X11R6/include -g -O2 -c FGTable.cpp FGTable.cpp: In method `void FGTable::Print()': FGTable.cpp:228: `ios_base' undeclared (first use this function) FGTable.cpp:228: (Each undeclared identifier is reported only once FGTable.cpp:228: for each function it appears in.) FGTable.cpp:228: parse error before `::' make[4]: *** [FGTable.o] Error 1 g++ 2.95.x lacks the Standard's ios_base class. One messy work around is demonstrated in simgear/misc/zfstream.hxx. FWIW I've been working on an alternative solution using namespaces that is much cleaner. It compiles with gcc 2.95.x and 3.0.x, Intel C++ and MSVC6. I believe that this should work void FGTable::Print(void) { int startRow; if (Type == tt1D) startRow = 1; else startRow = 0; ios::fmtflags flags = cout.setf(ios::fixed); // set up output stream cout.precision(4); for (int r=startRow; r=nRows; r++) { cout ; for (int c=0; c=nCols; c++) { if (r == 0 c == 0) { cout ; } else { cout Data[r][c] ; } } cout endl; } cout.setf(flags); // reset } ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] VOR TO/FROM
Hi, Going thru the FG nav code for FG I noticed the To/From flag calculation in radiostack.cxx. Someone might want to checkon the method of calculation. I believe the to/from is independent of aircraft heading and only denotes position left or right of the orthogonal vector to the selected radial. for example: If 090 is the selected radial then if I'm west of the 0-180 vector bisecting the station the indication is TO and if I'm east of the vector the indication is FROM. regards John W.
Re: [Flightgear-devel] FreeGLUT
On Sun, Jan 06, 2002 at 10:34:46PM +, Ross Golder wrote: It seems Mesa 4.0.1 doesn't come with glut, like 3.4. Has using freeglut been discussed before? I couldn't find anything in the archives. http://freeglut.sf.net/ Besides being maintained upstream, are there any benefits to freeglut? I ask because I maintain the glut package for Debian and have been considering packaging freeglut as well. -- James (Jay) Treacy [EMAIL PROTECTED] ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] VOR TO/FROM
You are correct; I'll have to look at it too, now. I believe the to/from is independent of aircraft heading and only denotes position left or right of the orthogonal vector to the selected radial. ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] VOR TO/FROM
Going thru the FG nav code for FG I noticed the To/From flag calculation in radiostack.cxx. I think it's ok; you might be confusing the nav_heading variable with the aircraft_heading variable; the former is simply the actual radial. Using the latter would give the behavior you're implying. ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
RE: [Flightgear-devel] Compile error latest CVS
Behalf Of David Megginson Thanks -- I'll fix that tomorrow, if people don't mind waiting. It's an ANSI/non-ANSI C++ thing. That would be great, David. Been very, very, busy today! And I am all smiles, now. Jon ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel