Using Chipmunk in Code::Blocks 10.05 for your own Project

Official forum for the Chipmunk2D Physics Library.
Post Reply
askaiser
Posts: 5
Joined: Sun Jul 04, 2010 5:02 pm
Contact:

Using Chipmunk in Code::Blocks 10.05 for your own Project

Post by askaiser »

Hello

(I am French, I hope Slembcke will correct this message if he thinks it's important. <3 google translator)

I managed to run the library Chipmunk (latest) with the C/C++ IDE, Code:: Blocks 10.05, and I wanted to share it.

I created a basic project, which call only the function cpInitChipmunk() in the main function :

Code: Select all

#include <stdio.h>
#include <stdlib.h>
#include "../chipmunk/chipmunk.h"

int main()
{
    cpInitChipmunk();

    return 0;
}
As Slembcke said, Chipmunk was written using C99, I added this build option to the project like this :
(It doesn't appears after re-opening the project in the dialogbox but still exists)

Image

This empty project is downloadable HERE, if you want to define it as the default template for futures Chipmunk's projects go to:
"File" -> "Save project as template ..."

If anybody wants more information about how to add openGl or SDL library to a codeblocks project, just say it.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Using Chipmunk in Code::Blocks 10.05 for your own Project

Post by slembcke »

You should also add -ffast-math. It disables expensive NaN checks which Chipmunk does not require.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
askaiser
Posts: 5
Joined: Sun Jul 04, 2010 5:02 pm
Contact:

Re: Using Chipmunk in Code::Blocks 10.05 for your own Project

Post by askaiser »

Thanks a lot.
mobilebros
Posts: 90
Joined: Tue Aug 04, 2009 9:53 am
Contact:

Re: Using Chipmunk in Code::Blocks 10.05 for your own Project

Post by mobilebros »

@askaiser - I'm guessing the VS 2008 project from the previous topic wouldn't compile for you?
askaiser
Posts: 5
Joined: Sun Jul 04, 2010 5:02 pm
Contact:

Re: Using Chipmunk in Code::Blocks 10.05 for your own Project

Post by askaiser »

There were errors in the compiler options, so I tried Code::Blocks.

But then I found the solution for your VS 2008 project as I mentioned in another topic.
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests