Problem with including chipmunk.h

Official forum for the Chipmunk2D Physics Library.
Post Reply
MatthewHudghton
Posts: 9
Joined: Mon Oct 06, 2008 8:46 pm
Contact:

Problem with including chipmunk.h

Post by MatthewHudghton »

hi, i've got chipmunk working on my set up, and am now trying to implement it into my spaceship game.
I followed the tutorial on how to set up in Visual studio 2008 express which i am using and everything works fine, however whenever i try to include the chipmunk.h file within the header file of one of my classes (Actor) it won't compile and throws up the error :

e:\documents and settings\matthew hudghton\my documents\visual studio 2008\projects\sector42\sector42\chp\chipmunk.h(30) : error C2084: function 'cpFloat cpfmax(cpFloat,cpFloat)' already has a body
e:\documents and settings\matthew hudghton\my documents\visual studio 2008\projects\sector42\sector42\chp\chipmunk.h(29) : see previous definition of 'cpfmax'
e:\documents and settings\matthew hudghton\my documents\visual studio 2008\projects\sector42\sector42\chp\chipmunk.h(36) : error C2084: function 'cpFloat cpfmin(cpFloat,cpFloat)' already has a body
e:\documents and settings\matthew hudghton\my documents\visual studio 2008\projects\sector42\sector42\chp\chipmunk.h(35) : see previous definition of 'cpfmin'
e:\documents and settings\matthew hudghton\my documents\visual studio 2008\projects\sector42\sector42\chp\cpVect.h(22) : error C2011: 'cpVect' : 'struct' type redefinition
e:\documents and settings\matthew hudghton\my documents\visual studio 2008\projects\sector42\sector42\chp\cpVect.h(22) : see declaration of 'cpVect'
e:\documents and settings\matthew hudghton\my documents\visual studio 2008\projects\sector42\sector42\chp\cpVect.h(26) : error C2370: 'cpvzero' : redefinition; different storage class
e:\documents and settings\matthew hudghton\my documents\visual studio 2008\projects\sector42\sector42\chp\cpVect.h(26) : see declaration of 'cpvzero'
e:\documents and settings\matthew hudghton\my documents\visual studio 2008\projects\sector42\sector42\chp\cpVect.h(26) : error C2078: too many initializers
e:\documents and settings\matthew hudghton\my documents\visual studio 2008\projects\sector42\sector42\chp\cpVect.h(26) : fatal error C1903: unable to recover from previous error(s); stopping compilation

etc. etc.

so i'm alittle confused, thanks for any help

God bless!

-Matt
MatthewHudghton
Posts: 9
Joined: Mon Oct 06, 2008 8:46 pm
Contact:

Re: Problem with including chipmunk.h

Post by MatthewHudghton »

ok fixed now, i just searched forum and following a post put a
#ifndef _CHIPMUNK_H_
#define _CHIPMUNK_H_
and an
#endif
at the bottom, happy now, lol its late
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Problem with including chipmunk.h

Post by slembcke »

Yeah, I finally got around to adding those in trunk. Long overdue. Sorry about that.
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 9 guests