Box2D Forums

It is currently Thu Sep 02, 2010 3:49 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: error: 'finite' was not declared in this scope
PostPosted: Wed May 21, 2008 8:17 am 
Offline

Joined: Wed May 21, 2008 8:10 am
Posts: 2
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!


Top
 Profile  
 
 Post subject: Re: error: 'finite' was not declared in this scope
PostPosted: Sat May 24, 2008 1:22 pm 
Offline

Joined: Wed May 21, 2008 8:10 am
Posts: 2
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..


Top
 Profile  
 
 Post subject: Re: error: 'finite' was not declared in this scope
PostPosted: Tue Jan 20, 2009 4:28 am 
Offline

Joined: Sun Jan 18, 2009 5:39 am
Posts: 4
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group