Install chipmunk on Ubuntu

Official forum for the Chipmunk2D Physics Library.
Post Reply
Croonical
Posts: 2
Joined: Fri Apr 01, 2011 12:43 am
Contact:

Install chipmunk on Ubuntu

Post by Croonical »

Hello.

I'm opening this topic because i have some troubles with the chipmunk setup un Ubuntu. I've spent around 5hours to search and try most of the tutorials on that, and i still can't use any functions. Actually, the link between my files seems to be not correct.
So if someone could explain me in detail how it works, i would be grateful.

This is what i've done :
"cmake ." in the demo folder. Doesn't work. (i've installed Glut now and i have not tried it again yet)
"cmake ." in the src folder. It works but i don't know what to do then >_>
I added "-std=c99" in my compiler option
I added the src folder in the "search directories"
I've defined the M_PI value which was unknown.

And i still have errors like hell.
I'm working on Ubuntu 10.10, using CodeBlocks as IDE.

So if someone could show me the procedure :) from the start.
I'm not an expert at all, first time on linux, and only 2 years of programming (only 6 monthes with C). But this is not the first library i'm using.

Thanks for your reading, and your possible help :)
With regard,

Croonical.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Install chipmunk on Ubuntu

Post by slembcke »

What went wrong with the cmake build? You do either need to turn off the demos in the build (they default to on), or install glut and it's support libraries (xmu I think?). I'd highly recommend using the cmake file to build it as it will get all of the optimizations flags correct which can have a big impact on speed.

I fixed the M_PI issue in trunk by defining it conditionally. Until a month or two ago, I thought it was part of the standard math library (it's defined by like 95% of the compilers out there), but apparently not. You can either check out trunk from the Google Code page or just add the definition to one of the headers.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Croonical
Posts: 2
Joined: Fri Apr 01, 2011 12:43 am
Contact:

Re: Install chipmunk on Ubuntu

Post by Croonical »

Hey again !

Thank you for your quick answer.
After 2 more hours i finally get the way to use chipmunk in my projects, and it was actually quite simple.

As you said, i needed to install xmu and the other one (can't remember the name).
I turned off the demos in the build, but i don't think it has changed something (cause i was still able to launch the demo).
And finally i linked "libchipmunk.a" library which has been generated by the cmake into codeblocks (build option, linker settings).

It seems to be all find atm.

I thank you very much for your help.
It was really simple in fact, and it will take me 3 min if i had to do it again..

I may come back again here for another issue, but this one is over :)
Thank you again !

With regard,
Croonical.
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests