Page 1 of 1

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

Posted: Thu Jul 08, 2010 10:00 pm
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.

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

Posted: Thu Jul 08, 2010 11:58 pm
by slembcke
You should also add -ffast-math. It disables expensive NaN checks which Chipmunk does not require.

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

Posted: Fri Jul 09, 2010 1:33 pm
by askaiser
Thanks a lot.

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

Posted: Fri Jul 09, 2010 1:44 pm
by mobilebros
@askaiser - I'm guessing the VS 2008 project from the previous topic wouldn't compile for you?

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

Posted: Fri Jul 09, 2010 8:23 pm
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.