How To Use Chipmunk in Visual C++ '08 for your own Projects

Official forum for the Chipmunk2D Physics Library.

Re: How To Use Chipmunk in Visual C++ '08 for your own Projects

Postby parasight » Wed Mar 05, 2008 4:08 am

aisman, there is a configuration for static libraries. Choose ReleaseStatic or DebugStatic from the configuration selector.

Image

I haven't tested the resulting libraries though.

Peace

EDIT: I built the demos with the static library and they all seem to work flawless.
parasight
 
Posts: 4
Joined: Fri Feb 29, 2008 2:20 am

Re: How To Use Chipmunk in Visual C++ '08 for your own Projects

Postby parasight » Sat Mar 08, 2008 3:55 pm

Update: I integrated the Chipmunk demos into the Visual Studio 2005 solution.

http://www.sportify.org/dl/Chipmunk-4.0.2-win32.rar
parasight
 
Posts: 4
Joined: Fri Feb 29, 2008 2:20 am

Re: How To Use Chipmunk in Visual C++ '08 for your own Projects

Postby Scallat » Sat Apr 12, 2008 12:40 pm

I'm having a bit of a problem with this and I wonder if you can help. I've followed all of the instructions you gave and the chimpmunk tutorials ran nicely but when I came to try and use chipmunk in my own program. I get a linker error telling me that the linker cannot find the files in the list:
chipmunk.obj
cpArbiter.obj
cpArray.obj
cpBB.obj
cpBody.obj
cpCollision.obj
cpHashSet.obj
cpJoint.obj
cpPolyShape.obj
cpShape.obj
cpSpace.obj
cpSpaceHash.obj
cpVect.obj

Have you got any idea why this is?
Scallat
 
Posts: 2
Joined: Sat Apr 12, 2008 12:27 pm

Re: How To Use Chipmunk in Visual C++ '08 for your own Projects

Postby Scallat » Sun Apr 13, 2008 5:41 pm

Nevermind I spotted my error.
Scallat
 
Posts: 2
Joined: Sat Apr 12, 2008 12:27 pm

Re: How To Use Chipmunk in Visual C++ '08 for your own Projects

Postby Das Gurke » Fri Aug 01, 2008 9:38 am

Has anybody been able to "embed" Chipmunk in some own VC++ 2005 project? I am currently trying to do this and fail quite badly :(

The provided MSVC++ 2005 Solution compiles nicely and out of the box. So I *could* directly link to the object code but ... Thats not what I would call a clean solution. Instead I would like to simply add all the source files to the project and then compile it.

So I took a close look at the Project Settings but could not find any difference except for two defines. So I added those, but that did not help.

I am aware that some people are providing static linking solutions. Thats not too bad, but not exactly what I want.

What puzzles me is, that MSVC++ 2005 does not seem to be C99 compliant, but the "original" solution somehow compiles.

Edit: Hehe, nevermind ... Simply compile the stuff as C++ Code (eg by changing the extension to .cpp) and the Visual Studio is happy ;)
Das Gurke
 
Posts: 6
Joined: Fri Aug 01, 2008 9:24 am

Re: How To Use Chipmunk in Visual C++ '08 for your own Projects

Postby debug » Tue Nov 25, 2008 10:34 am

I actually made mine a static library version for 2008 SP1
You should note in the steps some additional things

1) remove the /WP64 ( 64 bit portability warnings ) compiler flag it is deprecated

to make a static lib

1) change the project type on the main "general" page of the project file settings to "Static library (.lib)"
2) check your librarian page for a sensible output filename
3) add the .lib to your linker input page on the project you want to use it
4) add the include path to the c++ general page on the project you want to use it

All works properly as static lib

Other things i did

IFDEF'd the section in the code with the sprintf in it to use the secure version sprintf_s when compiling against windows
changed all occurances of fmof and fabsf to fmod and fabs so it compiles without warnings against typedef double cpFloat
debug
 
Posts: 19
Joined: Sun Nov 23, 2008 4:42 pm

Re: How To Use Chipmunk in Visual C++ '08 for your own Projects

Postby jeffcortes » Tue Dec 09, 2008 12:41 am

Hello,
I did what the instructions said up to where I compile and run the demo application (it appeared to compile fine). When I press f5 to run the program I get an error that says "this application failed to start because glut31.dll was not found. Re-installing the application may fix this problem."

Strangely, glut32.dll is present in the MSVCSolution folder yet the error persists. I'm very new to VC++ so please be very specific.

thanks,
Jeff
jeffcortes
 
Posts: 2
Joined: Tue Dec 09, 2008 12:35 am

Re: How To Use Chipmunk in Visual C++ '08 for your own Projects

Postby jeffcortes » Wed Dec 10, 2008 12:45 am

Hi again,
I solved the problem above "this application failed to start because glut32.dll was not found. Re-installing the application may fix this problem."

If anyone has the same problem, right click the project (Chipmunk4MSVC2k3) in the solution explorer, and select "References..." Expand "Configuration Properties", then "Debugging" in the left pane. In the right pane under "Environment" type PATH="glut32.dll path" where "glut32.dll path" is the path of the folder containing glut32.dll (without quotes). then it should work.
jeffcortes
 
Posts: 2
Joined: Tue Dec 09, 2008 12:35 am

Re: How To Use Chipmunk in Visual C++ '08 for your own Projects

Postby kevingy » Tue Jan 20, 2009 9:03 am

theanzelm wrote:- now in the menu open "Tools/Options..."
- in the Options Window go to "Projects and solutions/VC++ Directories"
- select "Include Files"
- add a directory
- enter: "<extracted Folder>/Chipmunk-X.X.X/src"


Adding the include directory here should only be done if you're using Chipmunk in a significant number of your MSVC projects. When the compiler is looking for include files, it will search these paths in order until it finds the file it's looking for. If you add the path here (especially if added at the top before the Microsoft libraries), you will slow down every compilation that does not include Chipmunk files. Sure, Chipmunk is small and the delay will be minor, but there is a delay. If you're doing this for every project you build, it won't take long for the IDE search path list (and therefore the delay) to be HUGE.

Instead, add the include path to the project settings. (The above directions add it to the IDE settings.) Open the project settings. Under "Configuration Properties", "C++", and "General", the path is added to the "Additional Include Directories". This way, each project searches only what it needs to search rather than having all projects searching the enirety of your hard drive.

$.02

Kevin
kevingy
 
Posts: 1
Joined: Tue Jan 20, 2009 8:45 am

Re: How To Use Chipmunk in Visual C++ '08 for your own Projects

Postby zzzzrrr » Thu Oct 22, 2009 8:42 pm

I've noticed that this thread hasn't been updated in awhile. Has anyone had any recent success building Chipmunk latest w/ VC++ '08? I tried to build the solution, but it looks like the trunk (demos?) may have been refactored since it was last updated...

I need to a dll for 64 bit Windows 7, so that I can utilize the Pymunk bindings. Anyone have any good suggestions?

Thanks!
zzzzrrr
 
Posts: 3
Joined: Thu Oct 22, 2009 8:37 pm

PreviousNext

Return to Chipmunk2D Physics

Who is online

Users browsing this forum: No registered users and 1 guest