Compiling on Code::Blocks?

Official forum for the Chipmunk2D Physics Library.
Post Reply
neos300
Posts: 2
Joined: Thu Feb 17, 2011 5:12 pm
Contact:

Compiling on Code::Blocks?

Post by neos300 »

Has anyone been able to compile Chipmunk on Code::Blocks with gcc? I keep getting compiler errors.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Compiling on Code::Blocks?

Post by slembcke »

There is this thread: http://www.slembcke.net/forums/viewtopi ... ocks#p6052

You might also try generating a code blocks project from the cmake files.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
neos300
Posts: 2
Joined: Thu Feb 17, 2011 5:12 pm
Contact:

Re: Compiling on Code::Blocks?

Post by neos300 »

Here are the compiler errors:

C:\c++\ChipmunkLib\chipmunk.c:70: error: 'M_PI' undeclared (first use in this function)
C:\c++\ChipmunkLib\chipmunk.c:70: error: (Each undeclared identifier is reported only once
C:\c++\ChipmunkLib\chipmunk.c:70: error: for each function it appears in.)
C:\c++\ChipmunkLib\chipmunk.c: In function 'cpAreaForSegment':
C:\c++\ChipmunkLib\chipmunk.c:85: error: 'M_PI' undeclared (first use in this function)

Apparently M_PI is gone in C99, is Chipmunk really C99 compliant?
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Compiling on Code::Blocks?

Post by slembcke »

It seems you are correct, and according to wikipedia M_PI was never actually part of the C standard math library anyway. Good to know. Apparently o

A simple define statement will fix that though:
#define M_PI 3.14159265358979323846264338327950288

I also committed the fix to trunk.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests