[Flightgear-devel] Simgear compile error: min function
I just did an update from cvs and got this when trying to build: In file included from ../../simgear/math/SGMath.hxx:32, from ../../simgear/math/point3d.hxx:54, from ../../simgear/math/sg_types.hxx:41, from sg_socket.hxx:39, from socktest.cxx:6: ../../simgear/math/SGQuat.hxx:134:35: macro min requires 2 arguments, but only 1 given ../../simgear/math/SGQuat.hxx:165:47: macro min requires 2 arguments, but only 1 given ../../simgear/math/SGQuat.hxx:166:47: macro min requires 2 arguments, but only 1 given ../../simgear/math/SGQuat.hxx:181:47: macro min requires 2 arguments, but only 1 given ../../simgear/math/SGQuat.hxx:182:47: macro min requires 2 arguments, but only 1 given ../../simgear/math/SGQuat.hxx:205:32: macro min requires 2 arguments, but only 1 given ../../simgear/math/SGQuat.hxx:212:41: macro min requires 2 arguments, but only 1 given ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Simgear compile error: min function
In file included from ../../simgear/math/SGMath.hxx:32, from ../../simgear/math/point3d.hxx:54, from ../../simgear/math/sg_types.hxx:41, from sg_socket.hxx:39, from socktest.cxx:6: ../../simgear/math/SGQuat.hxx:134:35: macro min requires 2 arguments, but only 1 given Here is the offending code for the first error: /// Create a quaternion from the angle axis representation where the angle /// is stored in the axis' length static Squat fromAngleAxis(const SGVec3T axis) { T nAxis = norm(axis); if (nAxis = SGLimitsT::min()) return SGQuat(1, 0, 0, 0); T angle2 = 0.5*nAxis; return fromRealImag(cos(angle2), T(sin(angle2)/nAxis)*axis); } Is it legal to call a min function with no arguments? The compiler doesn't seem to think so, at least. Jon ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Simgear compile error: min function
On Saturday 17 June 2006 22:06, Jon S. Berndt wrote: In file included from ../../simgear/math/SGMath.hxx:32, from ../../simgear/math/point3d.hxx:54, from ../../simgear/math/sg_types.hxx:41, from sg_socket.hxx:39, from socktest.cxx:6: ../../simgear/math/SGQuat.hxx:134:35: macro min requires 2 arguments, but only 1 given Here is the offending code for the first error: /// Create a quaternion from the angle axis representation where the angle /// is stored in the axis' length static Squat fromAngleAxis(const SGVec3T axis) { T nAxis = norm(axis); if (nAxis = SGLimitsT::min()) return SGQuat(1, 0, 0, 0); T angle2 = 0.5*nAxis; return fromRealImag(cos(angle2), T(sin(angle2)/nAxis)*axis); } Is it legal to call a min function with no arguments? The compiler doesn't seem to think so, at least. Perfectly legal. That is a static member of SGLimitsT that is basically the same than std::numeric_limits. That in turn has a min static member. On windows, you have that nasty windows.h header defining a min and max macro that will interfere with the ISO C++ standard. Dig into the windows headers, there is a way to avoid windows.h defining that macro. Greetings Mathias -- Mathias Fröhlich, email: [EMAIL PROTECTED] ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Simgear compile error: min function
Perfectly legal. That is a static member of SGLimitsT that is basically the same than std::numeric_limits. That in turn has a min static member. On windows, you have that nasty windows.h header defining a min and max macro that will interfere with the ISO C++ standard. Dig into the windows headers, there is a way to avoid windows.h defining that macro. Greetings Mathias This is under Cygwin, so it's a little surprising. I've been compiling this way for years and this is the first I've seen of it. Is this a relatively new change in the code? Jon ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Simgear compile error: min function
On Saturday 17 June 2006 22:15, Jon S. Berndt wrote: This is under Cygwin, so it's a little surprising. I've been compiling this way for years and this is the first I've seen of it. Is this a relatively new change in the code? About a year or so ... It is not the first time I hit this nasty defines. But I can never remember what needs to be done to get rid of them. With the lack of a win system here, you have to dig yourself ... greetings Mathias -- Mathias Fröhlich, email: [EMAIL PROTECTED] ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Simgear compile error: min function
Jon S. Berndt schrieb: Perfectly legal. That is a static member of SGLimitsT that is basically the same than std::numeric_limits. That in turn has a min static member. On windows, you have that nasty windows.h header defining a min and max macro that will interfere with the ISO C++ standard. Dig into the windows headers, there is a way to avoid windows.h defining that macro. Greetings Mathias This is under Cygwin, so it's a little surprising. I've been compiling this way for years and this is the first I've seen of it. Is this a relatively new change in the code? Jon I could not compile SimGear CVS under CYGWIN for a short time due to this error. Will now try to make the changes recommended. Thank you Jon for making it public. Georg EDDW ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Simgear compile error: min function
Mathias Fröhlich schrieb: On Saturday 17 June 2006 22:15, Jon S. Berndt wrote: This is under Cygwin, so it's a little surprising. I've been compiling this way for years and this is the first I've seen of it. Is this a relatively new change in the code? About a year or so ... Hmmm, I *could* compile SimGear CVS under Cygwin without any problems until now. The only thing I did in the last weeks was to try to get TerraGear running under Cygwin (without success) and downloaded some additional stuff for Cygwin. Really strange. Thank you for your hint, Mathias! Regards Georg ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Simgear compile error: min function
This is under Cygwin, so it's a little surprising. I've been compiling this way for years and this is the first I've seen of it. Is this a relatively new change in the code? Jon I could not compile SimGear CVS under CYGWIN for a short time due to this error. Will now try to make the changes recommended. Thank you Jon for making it public. Georg EDDW George: If you find the fix, please make *that* public! :-) I've got a headache after looking through this for a while, and I've already spent more time on this than I have. I'm DITW (dead in the water) until this is resolved. Thanks, Jon ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Simgear compile error: min function
On Saturday 17 June 2006 22:24, Georg Vollnhals wrote: I could not compile SimGear CVS under CYGWIN for a short time due to this error. Will now try to make the changes recommended. Thank you Jon for making it public. There is a #define that saves windows.h from defining the min and max macro. Either grep for them in cgwin's includes or use google ... May be we can include that in a generic simgear header? Greetings Mathias -- Mathias Fröhlich, email: [EMAIL PROTECTED] ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Simgear compile error: min function
Mathias Fröhlich schrieb: On Saturday 17 June 2006 22:24, Georg Vollnhals wrote: I could not compile SimGear CVS under CYGWIN for a short time due to this error. Will now try to make the changes recommended. Thank you Jon for making it public. There is a #define that saves windows.h from defining the min and max macro. Either grep for them in cgwin's includes or use google ... May be we can include that in a generic simgear header? Greetings Mathias I am just trying to find that needle but I am blind! But not giving up for the next hour. Regards Georg ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Simgear compile error: min function
On Saturday 17 June 2006 22:44, Georg Vollnhals wrote: I am just trying to find that needle but I am blind! But not giving up for the next hour. Ok, google tells me that #define NOMINMAX or equivalently CPPFLAGS=-DNOMINMAX ./configure --whatever-you-like does the trick. Tell me if this is ok ... Greetings Mathias -- Mathias Fröhlich, email: [EMAIL PROTECTED] ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Simgear compile error: min function
Jon S. Berndt writes: This is under Cygwin, so it's a little surprising. I've been compiling this way for years and this is the first I've seen of it. Is this a relatively new change in the code? Jon I could not compile SimGear CVS under CYGWIN for a short time due to this error. Will now try to make the changes recommended. Thank you Jon for making it public. Georg EDDW George: If you find the fix, please make *that* public! :-) I've got a headache after looking through this for a while, and I've already spent more time on this than I have. I'm DITW (dead in the water) until this is resolved. You need to include either config.h or simgear_config.h (can't remember which one offhand for SimGear) as the first include in the offending source (cxx or cpp) file. This picks up the NOMINMAX definition. Alternatively define NOMINMAX globally as Mattias say's later on. Cheers - Dave ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Simgear compile error: min function
Mathias Fröhlich writes On Saturday 17 June 2006 22:44, Georg Vollnhals wrote: I am just trying to find that needle but I am blind! But not giving up for the next hour. Ok, google tells me that #define NOMINMAX or equivalently CPPFLAGS=-DNOMINMAX ./configure --whatever-you-like does the trick. Tell me if this is ok ... It is easy to fix this once and for all ... http://cvs.flightgear.org/cgi-bin/viewcvs/viewcvs.cgi/SimGear/simgear/compiler.h.diff?r1=1.1r2=1.2cvsroot=SimGear-0.3 ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Simgear compile error: min function
Mathias Fröhlich schrieb: On Saturday 17 June 2006 22:44, Georg Vollnhals wrote: I am just trying to find that needle but I am blind! But not giving up for the next hour. Ok, google tells me that #define NOMINMAX or equivalently CPPFLAGS=-DNOMINMAX ./configure --whatever-you-like does the trick. Tell me if this is ok ... Greetings Mathias Hi Mathias and Jon, CPPFLAGS=-DNOMINMAX ./configure --xx removed this error. I already found out before your message that the \cygwin\usr\include\w32api\windef.h is the bad guy with the definition of #ifndef NOMINMAX #ifndef max #define max(a,b) ((a)(b)?(a):(b)) #endif #ifndef min #define min(a,b) ((a)(b)?(a):(b)) #endif #endif Could we just place the following into the constants.h of SimGear? #ifndef NOMINMAX #define NOMINMAX I did not try it but will do this night. Now I am off for an urgent walk with the dog before ... BUT THERE IS ANOTHER NEW ERROR so that SimGear does not compile: RenderTexture.cpp:1555: Fehler: WGL_SAMPLE_BUFFERS_ARB nicht deklariert (ers te Verwendung dieser Funktion) RenderTexture.cpp:1555: Fehler: (Jeder nicht deklarierte Bezeichner wird nur ein mal fur jede Funktion, in der er vorkommt, gemeldet.) RenderTexture.cpp:1557: Fehler: WGL_SAMPLES_ARB nicht deklariert (erste Verw endung dieser Funktion) make[3]: *** [RenderTexture.o] Fehler 1 make[3]: Leaving directory `/home/Besitzer/SimGear-0.3-cvs/source/simgear/screen ' Sorry, error messages in German. Will come back later! Regards Georg EDDW ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Simgear compile error: min function
Jon S. Berndt wrote : I just did an update from cvs and got this when trying to build: In file included from ../../simgear/math/SGMath.hxx:32, from ../../simgear/math/point3d.hxx:54, from ../../simgear/math/sg_types.hxx:41, from sg_socket.hxx:39, from socktest.cxx:6: ../../simgear/math/SGQuat.hxx:134:35: macro min requires 2 arguments, but only 1 given A fix is in CVS now -Fred -- Frédéric Bouvier http://frfoto.free.fr Photo gallery - album photo http://www.fotolia.fr/p/2278 Other photo gallery http://fgsd.sourceforge.net/ FlightGear Scenery Designer ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Simgear compile error: min function
Thank you to all who helped to solve the SimGear min function compile error. Jon, I got a second error while further compiling. If you also have the RenderTexture.cpp:1555: Fehler: WGL_SAMPLE_BUFFERS_ARB error then my very ugly workaround might help you. (I am no C-guy and all further is far behind my scope): FILE TO CHANGE: C:\cygwin\home\Besitzer\SimGear-0.3-cvs\source\simgear\screen\exte nsions.hxx I didn't get thsi error. However, I did get pages of FlightGear errors similar to the SimGear one - not really unexpected, I guess. example: /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/locale_facets.tcc:514:57: macro min requires 2 arguments, but only 1 given /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/locale_facets.tcc:563:57: macro max requires 2 arguments, but only 1 given /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/istream.tcc:146:36: macro min requires 2 arguments, but only 1 given /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/istream.tcc:147:46: macro max requires 2 arguments, but only 1 given etc. Jon ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Simgear compile error: min function
However, I did get pages of FlightGear errors similar to the SimGear one - not really unexpected, I guess. I applied the same process for FlightGear as with SimGear and got a good build: CPPFLAGS=-DNOMINMAX ./configure ... etc. Unfortunately, it immediately segfaults. Jon ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Simgear compile error: min function
Jon S. Berndt schrieb: ... I didn't get thsi error. However, I did get pages of FlightGear errors similar to the SimGear one - not really unexpected, I guess. example: /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/locale_facets.tcc:514:57: macro min requires 2 arguments, but only 1 given /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/locale_facets.tcc:563:57: macro max requires 2 arguments, but only 1 given /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/istream.tcc:146:36: macro min requires 2 arguments, but only 1 given /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/istream.tcc:147:46: macro max requires 2 arguments, but only 1 given etc. Jon OK, now we have two diffent problems with FlightGear CVS under Cygwin. You have this min-max problem, I'll get a glide-info one: gcc -g -O2 -D_REENTRANT -L/fg-cvs/lib -L/usr/local/lib -o gl-info.exe gl-info .o -lglut32 -lglu32 -lopengl32 -luser32 -lgdi32 gl-info.o: In function `getPrints': /home/Besitzer/FlightGear-0.9-cvs/source/tests/gl-info.c:29: undefined reference to `_glGetString' gl-info.o: In function `getPrint2f': /home/Besitzer/FlightGear-0.9-cvs/source/tests/gl-info.c:35: undefined reference to `_glGetFloatv' gl-info.o: In function `getPrintf': /home/Besitzer/FlightGear-0.9-cvs/source/tests/gl-info.c:42: undefined reference to `_glGetFloatv' gl-info.o: In function `getPrint2i': /home/Besitzer/FlightGear-0.9-cvs/source/tests/gl-info.c:49: undefined reference to `_glGetIntegerv' gl-info.o: In function `getPrinti': /home/Besitzer/FlightGear-0.9-cvs/source/tests/gl-info.c:56: undefined reference to `_glGetIntegerv' collect2: ld gab 1 als Ende-Status zuruck make[1]: *** [gl-info.exe] Fehler 1 make[1]: Leaving directory `/home/Besitzer/FlightGear-0.9-cvs/source/tests' make: *** [all-recursive] Fehler 1 What a pity, CVS compiling worked without problems for a very long time! Regards Georg EDDW ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Simgear compile error: min function
Unfortunately, it immediately segfaults. Jon I ran FlightGear from within gdb: (gdb) run Starting program: /usr/local/bin/fgfs.exe Program received signal SIGSEGV, Segmentation fault. 0x610ae938 in pthread_key_create () from /usr/bin/cygwin1.dll Does this suggest an error to anyonw? Jon ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Simgear compile error: min function
Unfortunately, it immediately segfaults. Jon I ran FlightGear from within gdb: (gdb) run Starting program: /usr/local/bin/fgfs.exe Program received signal SIGSEGV, Segmentation fault. 0x610ae938 in pthread_key_create () from /usr/bin/cygwin1.dll Does this suggest an error to anyonw? Jon Is there a way to turn off pthreads? What do pthreads buy me under Cygwin? Jon ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel