Jump to content
  • Advertisement
Sign in to follow this  
farmdve

I think I compiled chipmunk-physics engine with MinGW

This topic is 1882 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I didn't like it that it used Visual Studio, so I decided to give it ago and made this makefile

CC=gcc
LIBS=
PROGNAME=chipmunk
CFLAGS= -c -std=c99 -I../include/chipmunk -I../include/chipmunk/constraints
SRCS= ../src/chipmunk.c \
../src/cpArbiter.c \
../src/cpArray.c \
../src/cpBB.c \
../src/cpBBTree.c \
../src/cpBody.c \
../src/cpCollision.c \
../src/cpHashSet.c \
../src/cpPolyShape.c \
../src/cpShape.c \
../src/cpSpace.c \
../src/cpSpaceComponent.c \
../src/cpSpaceHash.c \
../src/cpSpaceQuery.c \
../src/cpSpaceStep.c \
../src/cpSpatialIndex.c \
../src/cpSweep1D.c \
../src/cpVect.c \
../src/constraints/cpConstraint.c \
../src/constraints/cpDampedRotarySpring.c \
../src/constraints/cpDampedSpring.c \
../src/constraints/cpGearJoint.c \
../src/constraints/cpGrooveJoint.c \
../src/constraints/cpPinJoint.c \
../src/constraints/cpPivotJoint.c \
../src/constraints/cpRatchetJoint.c \
../src/constraints/cpRotaryLimitJoint.c \
../src/constraints/cpSimpleMotor.c \
../src/constraints/cpSlideJoint.c

OBJS = $(SRCS:.c=.o)

all: $(OBJS)
	$(CC) $^ $(CFLAGS) $(LIBS)
	ar cr lib$(PROGNAME).a $(OBJS)

Place this file in a newly created mingw folder in the root folder of chipmunk-physics-6.1.5(or whichever version is new). It will then create libchipmunk.a, now I am not an expert, but if it compiles I assume it works, I cannot compile the demos as they used GLUT for the Windowing system and that doesn't have a MinGW port, plus I will be using SDL. However, I did compile the demos manually(without ChimpmunkDemo.c) by using libchimpmunk.a and it compiled without warnings and only two with -Wextra and -Wall.

 

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!