Chipmunk.def for 6.0.3 and VisualStudio 2010/09

Official forum for the Chipmunk2D Physics Library.
Post Reply
aisman
Posts: 145
Joined: Tue Mar 04, 2008 2:21 am
Contact:

Chipmunk.def for 6.0.3 and VisualStudio 2010/09

Post by aisman »

Maybe someone is missing the Chipmunk.def file on Chipmunk 6.0.3.
Here is it:

Code: Select all

LIBRARY

EXPORTS
_cpv
_cpveql
_cpvadd
_cpvneg
_cpvsub
_cpvmult
_cpvdot
_cpvcross
_cpvperp
_cpvrperp
_cpvproject
_cpvrotate
_cpvunrotate
_cpvlengthsq
_cpvlerp
_cpvnormalize
_cpvnormalize_safe
_cpvclamp
_cpvlerpconst
_cpvdist
_cpvdistsq
_cpvnear

_cpfmax
_cpfmin
_cpfabs
_cpfclamp
_cpflerp
_cpflerpconst

_cpBBNew
_cpBBNewForCircle
_cpBBIntersects
_cpBBContainsBB
_cpBBContainsVect
_cpBBMerge
_cpBBExpand
_cpBBArea
_cpBBMergedArea
_cpBBSegmentQuery
_cpBBIntersectsSegment

_cpBodyGetMass
_cpBodyGetMoment
_cpBodyGetPos
_cpBodyGetAngle
_cpBodyGetRot

_cpBodyGetVel
_cpBodyGetForce
_cpBodyGetAngVel
_cpBodyGetTorque
_cpBodyGetVelLimit
_cpBodyGetAngVelLimit
_cpBodyGetUserData
_cpBodySetVel
_cpBodySetForce
_cpBodySetAngVel
_cpBodySetTorque
_cpBodySetVelLimit
_cpBodySetAngVelLimit
_cpBodySetUserData

_cpBodyIsSleeping
_cpBodyIsStatic
_cpBodyIsRogue
_cpBodyLocal2World
_cpBodyWorld2Local
_cpBodyKineticEnergy

_cpShapeGetBB

_cpShapeGetBody
_cpShapeGetSensor
_cpShapeGetElasticity
_cpShapeGetFriction
_cpShapeGetSurfaceVelocity
_cpShapeGetUserData
_cpShapeGetCollisionType
_cpShapeGetGroup
_cpShapeGetLayers
_cpShapeSetBody
_cpShapeSetSensor
_cpShapeSetElasticity
_cpShapeSetFriction
_cpShapeSetSurfaceVelocity
_cpShapeSetUserData
_cpShapeSetCollisionType
_cpShapeSetGroup
_cpShapeSetLayers

_cpArbiterGetShapes
_cpArbiterGetBodies
_cpArbiterIsFirstContact
_cpArbiterGetCount

_cpConstraintGetA
_cpConstraintGetB
_cpConstraintSetMaxForce
_cpConstraintSetErrorBias
_cpConstraintSetMaxBias
_cpConstraintSetUserData
_cpConstraintSetMaxForce
_cpConstraintSetErrorBias
_cpConstraintSetMaxBias
_cpConstraintSetUserData
_cpConstraintGetImpulse

_cpDampedRotarySpringSetRestAngle
_cpDampedRotarySpringSetStiffness
_cpDampedRotarySpringSetDamping

_cpDampedRotarySpringSetRestAngle
_cpDampedRotarySpringSetStiffness
_cpDampedRotarySpringSetDamping


_cpDampedSpringGetAnchr1
_cpDampedSpringGetAnchr2
_cpDampedSpringGetRestLength
_cpDampedSpringGetStiffness
_cpDampedSpringGetDamping

_cpDampedSpringSetAnchr1
_cpDampedSpringSetAnchr2
_cpDampedSpringSetRestLength
_cpDampedSpringSetStiffness
_cpDampedSpringSetDamping


_cpGearJointGetPhase
_cpGearJointSetPhase
_cpGearJointGetRatio

_cpGrooveJointGetAnchr2
_cpGrooveJointSetAnchr2
_cpGrooveJointGetGrooveA
_cpGrooveJointGetGrooveB

_cpPinJointGetAnchr1
_cpPinJointGetAnchr2
_cpPinJointGetDist
_cpPinJointSetAnchr1
_cpPinJointSetAnchr2
_cpPinJointSetDist

_cpPivotJointGetAnchr1
_cpPivotJointGetAnchr2
_cpPivotJointSetAnchr1
_cpPivotJointSetAnchr2

_cpRatchetJointGetAngle
_cpRatchetJointGetPhase
_cpRatchetJointGetRatchet
_cpRatchetJointSetAngle
_cpRatchetJointSetPhase
_cpRatchetJointSetRatchet

_cpRotaryLimitJointGetMin
_cpRotaryLimitJointGetMax
_cpRotaryLimitJointSetMin
_cpRotaryLimitJointSetMax

_cpSimpleMotorGetRate
_cpSimpleMotorSetRate

_cpSlideJointGetAnchr1
_cpSlideJointGetAnchr2
_cpSlideJointGetMin
_cpSlideJointGetMax

_cpSlideJointSetAnchr1
_cpSlideJointSetAnchr2
_cpSlideJointSetMin
_cpSlideJointSetMax

_cpSegmentQueryHitPoint
_cpSegmentQueryHitDist

_cpSpatialIndexDestroy
_cpSpatialIndexCount
_cpSpatialIndexEach
_cpSpatialIndexContains
_cpSpatialIndexInsert
_cpSpatialIndexRemove
_cpSpatialIndexReindex
_cpSpatialIndexReindexObject
_cpSpatialIndexPointQuery
_cpSpatialIndexSegmentQuery
_cpSpatialIndexQuery
_cpSpatialIndexReindexQuery

_cpSpaceGetIterations
_cpSpaceGetGravity
_cpSpaceGetDamping
_cpSpaceGetIdleSpeedThreshold
_cpSpaceGetSleepTimeThreshold
_cpSpaceGetCollisionSlop
_cpSpaceGetCollisionBias
_cpSpaceGetCollisionPersistence
_cpSpaceGetEnableContactGraph
_cpSpaceGetUserData

_cpSpaceSetIterations
_cpSpaceSetGravity
_cpSpaceSetDamping
_cpSpaceSetIdleSpeedThreshold
_cpSpaceSetSleepTimeThreshold
_cpSpaceSetCollisionSlop
_cpSpaceSetCollisionBias
_cpSpaceSetCollisionPersistence
_cpSpaceSetEnableContactGraph
_cpSpaceSetUserData

_cpSpaceGetStaticBody
_cpSpaceGetCurrentTimeStep
_cpSpaceIsLocked
Chipmunk4PB: The fastest way to write games together with PureBasic and the Chipmunk physics engine.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Chipmunk.def for 6.0.3 and VisualStudio 2010/09

Post by slembcke »

Oh, shoot. I forgot to check if the MSVC project was up to date before releasing that. :-\
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
roflha
Posts: 4
Joined: Tue Dec 20, 2011 6:28 am
Contact:

Re: Chipmunk.def for 6.0.3 and VisualStudio 2010/09

Post by roflha »

I am not sure why, but this .def file is not working for me on the vc2010 project file.

When I try to compile in either of the DLL builds, I receive a bunch of lines like
1>chipmunk.def : error LNK2001: unresolved external symbol _cpArbiterGetBodies

All I did was created a file named chipmunk.def and put it in the Chipmunk-6.0.3\msvc\vc10\chipmunk folder. I then tried to build it with vs2010 and, well, I already said that part.

Any advice?
aisman
Posts: 145
Joined: Tue Mar 04, 2008 2:21 am
Contact:

Re: Chipmunk.def for 6.0.3 and VisualStudio 2010/09

Post by aisman »

Of course you have to define the CHIPMUNK_FFI preprocessor flag: add it to the preprocesser section on VS2010
Chipmunk4PB: The fastest way to write games together with PureBasic and the Chipmunk physics engine.
roflha
Posts: 4
Joined: Tue Dec 20, 2011 6:28 am
Contact:

Re: Chipmunk.def for 6.0.3 and VisualStudio 2010/09

Post by roflha »

Ah thank you, didn't know I had to do that.
Edit: Similar question, I can compile the library now, but the demo will not compile for me. I added the same preprocessor definition into the demo project as I did the chipmunk project, but now I am getting
"2>Bench.obj : error LNK2001: unresolved external symbol _cpSpaceNew"

I also tried adding the chipmunk.lib as an additional linker dependency but that failed too.
aisman
Posts: 145
Joined: Tue Mar 04, 2008 2:21 am
Contact:

Re: Chipmunk.def for 6.0.3 and VisualStudio 2010/09

Post by aisman »

Compile Chipmunk and Demo as static lib anf you will get the demo.exe
Chipmunk4PB: The fastest way to write games together with PureBasic and the Chipmunk physics engine.
hamlatzis
Posts: 2
Joined: Wed Jan 04, 2012 6:14 am
Contact:

Re: Chipmunk.def for 6.0.3 and VisualStudio 2010/09

Post by hamlatzis »

Similar problem with MS Visual Studio 2005 Prof and MS Visual Studio 2008 Express. DLL doesn't link with infinite unresolved externals.

If I create as suggested as a library then the demo has some unresolved externals

1>ChipmunkDemo.obj : error LNK2001: unresolved external symbol "int bench_count" (?bench_count@@3HA)
1>ChipmunkDemo.obj : error LNK2001: unresolved external symbol "struct ChipmunkDemo * bench_list" (?bench_list@@3PAUChipmunkDemo@@A)
1>ChipmunkDemo.obj : error LNK2001: unresolved external symbol "struct ChipmunkDemo Slice" (?Slice@@3UChipmunkDemo@@A)
1>ChipmunkDemo.obj : error LNK2001: unresolved external symbol "struct ChipmunkDemo Buoyancy" (?Buoyancy@@3UChipmunkDemo@@A)
1>ChipmunkDemo.obj : error LNK2001: unresolved external symbol "struct ChipmunkDemo ContactGraph" (?ContactGraph@@3UChipmunkDemo@@A)
1>ChipmunkDemo.obj : error LNK2001: unresolved external symbol "struct ChipmunkDemo Crane" (?Crane@@3UChipmunkDemo@@A)
1>ChipmunkDemo.obj : error LNK2001: unresolved external symbol "struct ChipmunkDemo Chains" (?Chains@@3UChipmunkDemo@@A)
1>ChipmunkDemo.obj : error LNK2001: unresolved external symbol "struct ChipmunkDemo BouncyHexagons" (?BouncyHexagons@@3UChipmunkDemo@@A)
1>chipmunk.lib(cpSpace.obj) : error LNK2019: unresolved external symbol _cpBBTreeSetVelocityFunc referenced in function _cpSpaceInit
1>chipmunk.lib(cpSpace.obj) : error LNK2019: unresolved external symbol _cpBBTreeNew referenced in function _cpSpaceInit
1>chipmunk.lib(cpSpace.obj) : error LNK2019: unresolved external symbol _cpSpatialIndexFree referenced in function _cpSpaceDestroy
1>chipmunk.lib(cpSpaceHash.obj) : error LNK2019: unresolved external symbol "struct cpSpatialIndex * __cdecl cpSpatialIndexInit(struct cpSpatialIndex *,struct cpSpatialIndexClass *,struct cpBB (__cdecl*)(void *),struct cpSpatialIndex *)" (?cpSpatialIndexInit@@YAPAUcpSpatialIndex@@PAU1@PAUcpSpatialIndexClass@@P6A?AUcpBB@@PAX@Z0@Z) referenced in function _cpSpaceHashInit
1>chipmunk.lib(cpSpaceHash.obj) : error LNK2019: unresolved external symbol _cpSpatialIndexCollideStatic referenced in function "void __cdecl cpSpaceHashReindexQuery(struct cpSpaceHash *,void (__cdecl*)(void *,void *,void *),void *)" (?cpSpaceHashReindexQuery@@YAXPAUcpSpaceHash@@P6AXPAX11@Z1@Z)
1>Debug DLL\demo.exe : fatal error LNK1120: 13 unresolved externals
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Chipmunk.def for 6.0.3 and VisualStudio 2010/09

Post by slembcke »

It looks like you aren't linking the demo modules maybe? Make sure all the other source files in the Demo/ directory are being linked.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
chrisanderman
Posts: 2
Joined: Sat Feb 04, 2012 3:09 am
Contact:

Re: Chipmunk.def for 6.0.3 and VisualStudio 2010/09

Post by chrisanderman »

I had the same problem, and as it turns out the solution is simple. Slice.c is missing from the msvc 2010 project file. Oops! Someone must have forgot to add it.

To fix this just go to demo->Source Files. Right click Source Files and click Add->Existing Item. In the browser navigate up one folder, then go into the Demo folder and double-click on Slice.c.

It should build fine now. I'm going to submit this as a bug unless it has already been reported.
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests