error: 'isnan' is not a member of 'std'

Questions or HOWTOs about the above? Post 'em here...
Post Reply
User avatar
AGeek
Private First Class
Private First Class
Posts: 64
Joined: Tue Jan 17, 2006 11:33 pm

error: 'isnan' is not a member of 'std'

Post by AGeek »

When compiling the latest CVS, i recieved three errors
CommandsImplementation.cxx:373: error: 'isnan' is not a member of 'std'
CommandsImplementation.cxx:392: error: 'isnan' is not a member of 'std'
CommandsImplementation.cxx:393: error: 'isnan' is not a member of 'std'

blast said i should ask the devs because they may have to fix something,


so is something wrong, or is xCode 2.2.1 broken?
System Info:
Mac OS 10.4.5
xCode 2.2.1
User avatar
AGeek
Private First Class
Private First Class
Posts: 64
Joined: Tue Jan 17, 2006 11:33 pm

Post by AGeek »

not to be annoying or anything, but i kind of want an answer for this badly :?
temporal distraction
Sergeant
Sergeant
Posts: 250
Joined: Wed Jan 05, 2005 3:12 pm

Post by temporal distraction »

It's probably no surprise that I get the same errors - same set-up. I see from the topic of #bzflag IRC channel: "CVS HEAD is now 2.1 unstable, commit stable to v2_0branch" - so I guess we just have to be patient.

Code: Select all

/usr/include/architecture/ppc/math.h:159:1: warning: this is the location of the previous definition
source='CommandsImplementation.cxx' object='CommandsImplementation.o' libtool=no \
depfile='.deps/CommandsImplementation.Po' tmpdepfile='.deps/CommandsImplementation.TPo' \
depmode=gcc3 /bin/sh ../../misc/depcomp \
g++ -DHAVE_CONFIG_H -I. -I. -I../../include  -I../../include    -pipe -pedantic -fno-exceptions -W -Wall -Wundef -Wno-import -O3 -ffast-math -fomit-frame-pointer -fexpensive-optimizations -fno-exceptions -g -O2 -c -o CommandsImplementation.o `test -f 'CommandsImplementation.cxx' || echo './'`CommandsImplementation.cxx
In file included from CommandsImplementation.cxx:14:
../../include/common.h:198:1: warning: "isnan" redefined
In file included from /usr/include/math.h:26,
                 from ../../include/common.h:35,
                 from CommandsImplementation.cxx:14:
/usr/include/architecture/ppc/math.h:159:1: warning: this is the location of the previous definition
CommandsImplementation.cxx: In function 'float parseFloatExpr(const std::string&, bool)':
CommandsImplementation.cxx:373: error: 'isnan' is not a member of 'std'
CommandsImplementation.cxx: In function 'bool varIsEqual(const std::string&)':
CommandsImplementation.cxx:392: error: 'isnan' is not a member of 'std'
CommandsImplementation.cxx:393: error: 'isnan' is not a member of 'std'
CommandsImplementation.cxx: In function 'float parseFloatExpr(const std::string&, bool)':
CommandsImplementation.cxx:378: warning: control reaches end of non-void function
make[2]: *** [CommandsImplementation.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1
mistake
Private First Class
Private First Class
Posts: 124
Joined: Wed Jun 15, 2005 12:12 am

Post by mistake »

Mh, seems that the standard template library is not compatible on your machine. Looks like you'll have to wait unti Xcode incorporates the latest standard template library, or until devs make a work around.

I may be wrong though.
mistake
inchworm
Private
Private
Posts: 4
Joined: Thu Sep 15, 2005 1:51 am

Same problem on AMD64

Post by inchworm »

Just a FYI, I tried compiling this on AMD64 (gentoo) and ran into the same error.
inchworm
Private
Private
Posts: 4
Joined: Thu Sep 15, 2005 1:51 am

isnan() is a function in <math.h>

Post by inchworm »

After doing a CVS update and no change in the problem (not a complaint at the devs) I started doing a little research. isnan() is a C function included from math.h The error is claiming that isnan() is not a member of standard, but why doesn't it go ahead and call the C function of the same name?
Enigma
Private First Class
Private First Class
Posts: 212
Joined: Sat Apr 23, 2005 3:13 am

Post by Enigma »

I get this error if I use std::isnan() with #include "math.h" instead of
#include <cmath>. The old .h headers put their contents in the global namespace; the new-style headers put their contents into the std namespace. Thats probably all it was.
User avatar
optic delusion
Special Forces
Special Forces
Posts: 1052
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Post by optic delusion »

Slayer++ wrote: Thats probably all it was.
That implies that you somehow resolved the problem. It may surprise you that not all of us around here have the kind of knowledge required to reliably compile cvs versions of this game. If you know of some argument we can use in our compile, that can provide us with resolution of our problem. please post clearly, exactly what it is. We would be eternally grateful.

inchworm and slayer++, I wouldn't mind having a little conversation with either one of you.
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.
inchworm
Private
Private
Posts: 4
Joined: Thu Sep 15, 2005 1:51 am

Post by inchworm »

OK.. a couple of things
the cvs version is unstable. I just played with it now and several things were broken, like seeing your shots and seeing buildings :shock: . Also, for now obvious reasons, this unstable version is not backwards compatible. You will not be able to play on the standard servers. Having said that here are the steps I had to take to get it working.

reference this under the section "What is this NaN thing?"
there is some code for my_isnan()
http://new-brunswick.net/workshop/c++/faq/newbie.html

every time g++ complains about isnan, go to that file and insert the my_isnan funcion near the top, then do a global find and replace with isnan with my_isnan. Also for me, my cmath library for c++ is sorta broken be cause the compiler barfed on any reference to cmath. I had to replace references to cmath with math.h

the files I had to modify were:
src/bzflag/CommandsImplementation.cxx
src/bzflag/playing.cxx
src/bzadmin/BZAdminClient.cxx (cmath to math.h)

best of luck, don't overwrite your stable client like I did :)
User avatar
optic delusion
Special Forces
Special Forces
Posts: 1052
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Post by optic delusion »

You made a copy of BZFlag 2.1. My guess is six months until that is ready for release. To get a copy of 2.0.5b8 (or whatever the 2.0 branch now produces) you need this argument.
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/bzflag co -P -r v2_0branch bzflag
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.
User avatar
A Meteorite
Private First Class
Private First Class
Posts: 1786
Joined: Thu Apr 28, 2005 12:56 am
Location: California, U.S.
Contact:

Post by A Meteorite »

Just to let everyone know anon cvs is two weeks behind from that outage earlier.
Image
Owner @ BZFX
Core Admin @ CAN

Email me: bzmet…@gmail.com
kahcepb[RU]
Private First Class
Private First Class
Posts: 16
Joined: Wed Jan 19, 2005 8:49 am
Location: Moscow, Russia
Contact:

Post by kahcepb[RU] »

A Meteorite wrote:Just to let everyone know anon cvs is two weeks behind from that outage earlier.
When stable version _is_ released this outage look pretty strange (bzflag-2.0.6-20060409 compiled on linux from sources downloaded from sourceforge HAS regressions 2.0.5-devel hasn't).

Evil.
Post Reply