Box2D Forums
http://www.box2d.org/forum/

error: 'finite' was not declared in this scope
http://www.box2d.org/forum/viewtopic.php?f=7&t=893
Page 1 of 1

Author:  Chris B [ Wed May 21, 2008 8:17 am ]
Post subject:  error: 'finite' was not declared in this scope

Hi everyone,
I'm really eager to try this neat library out, but I just can't get the engine to compile.

I'm using Codeblocks + MinGW under WinXP and after opening the workspace in Build/Codeblocks and pressing "compile" I get the following error and a warning in b2math.h in line 62:

error: 'finite' was not declared in this scope
warning: unused variable 'fninite'

Pls help!

Author:  Chris B [ Sat May 24, 2008 1:22 pm ]
Post subject:  Re: error: 'finite' was not declared in this scope

I solved the problem.
To recapitulate: Common/b2math.h gave an error, so here's what I did:

1. I edited out the line:
Code:
#include <cmath>


2. I added the line:
Code:
#include <math.h>


3. I edited the line:
Code:
   return finite(x) != 0;

to:
Code:
   return isfinite(x) != 0;



As far as I can tell the function isfinite() seems to work just like finite() / _finite():
http://www.java2s.com/Tutorial/C/0340__ ... finite.htm
(returns non-zero if finite, 0 otherwise.)

Still don't know why CodeBlocks+MinGW dosn't like finite(), but anyway..

Author:  caxaria [ Tue Jan 20, 2009 4:28 am ]
Post subject:  Re: error: 'finite' was not declared in this scope

Thanks mate, I was having this same issue with box2d 2.0.1, on a Mac with XCode.

If you're ever in Portugal, I'll buy you a beer.

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/