Jump to content

View more

Image of the Day

The beast has a mighty searchlight of evil! #screenshotsaturday https://t.co/bzKepOojDL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Sign up now

I think I compiled chipmunk-physics engine with MinGW

4: Adsense
  • You cannot reply to this topic
No replies to this topic

#1 farmdve   Members   


Posted 25 August 2013 - 04:59 AM

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

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 \

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.