Build path for MSVC/Windows.

Official forum for the Chipmunk2D Physics Library.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Build path for MSVC/Windows.

Post by slembcke »

Well, I think that I have cleaned up most of the problems that I'm aware of. It builds cleanly as C++ under g++ now. Anyone willing to give it a try and see if there's anything that I missed?

Current SVN dump: http://files.slembcke.net/temp/ChipmunkMSVC.tgz

If things go well, send me the project file and I can add it to subversion.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
smg
Posts: 10
Joined: Thu Aug 23, 2007 11:26 am
Contact:

Re: Build path for MSVC/Windows.

Post by smg »

Hi Scott,

I tried your new version and there were still a few things, that needed to be fixed. You can download the version that I fixed here. I hope this one still works for you. ;) It also contains a working MSVC 2005 (Express) project. Here is the list of all the things that I changed (with linenumbers):
  • chipmunk.h
    - 41 error C2177: constant too big: INFINITY
  • cpVect.h
    - 29 error C2059: syntax error : '{' (changed to constant)
    - 31 "
  • cpBB.c
    - 33 error C2059: syntax error : '{'
  • cpBody.c
    - 89 error C2666: 'fmod' : 3 overloads have similar conversions
  • cpSpace.c
    - 144 error C2059: syntax error : '{'
    - 220 "
    - 223 "
  • cpSpaceHash.c
    - 329 error C2059: syntax error : '{'
  • chipmunk.c
    - 48 error C2057: expected constant expression
    (changed for _WINDOWS to use new/delete operators
  • Demo3.c
    - 69 error C2057: expected constant expression
    (changed num to const int)
If anyone wants to create a new MSVC project, the following things have to be considered:
  • compile all chipmunk *.c files as c++ code (advanced compiler settings)
  • define _USE_MATH_DEFINES in c++ preprocessor settings
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Build path for MSVC/Windows.

Post by slembcke »

Ok, I think it should be merged successfully now. Anyone want to give it a try?

http://files.slembcke.net/temp/ChipmunkMSVC.tgz

One thing though, is there something more specific to MSVC that can be used in place of _WINDOWS. I assume that minGW would also supply the _WINDOWS token.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
W.P. van Paassen
Posts: 16
Joined: Tue Aug 21, 2007 3:53 am
Contact:

Re: Build path for MSVC/Windows.

Post by W.P. van Paassen »

slembcke wrote: One thing though, is there something more specific to MSVC that can be used in place of _WINDOWS. I assume that minGW would also supply the _WINDOWS token.
_WIN32

cheers,
W.P.
joshcryer
Posts: 18
Joined: Wed Sep 26, 2007 8:19 pm
Contact:

Re: Build path for MSVC/Windows.

Post by joshcryer »

I got the .zip file working, that is, compiling to a static lib, but when I try to build the demos, I get errors like this:

C:\programs\Chipmunk\include\chipmunk.h(29) : error C2054: expected '(' to follow 'inline'
c:\programs\Chipmunk\include\chipmunk.h(30) : error C2085: 'cpfmax' : not in formal parameter list
c:\programs\Chipmunk\include\chipmunk.h(30) : error C2143: syntax error : missing ';' before '{'
c:\programs\Chipmunk\include\chipmunk.h(35) : error C2054: expected '(' to follow 'inline'
c:\programs\Chipmunk\include\chipmunk.h(36) : error C2085: 'cpfmin' : not in formal parameter list
c:\programs\Chipmunk\include\chipmunk.h(36) : error C2143: syntax error : missing ';' before '{'

What is weird is that it compiles just fine as a static lib (or even as a .dll). This is just so odd, I cannot figure out what's different in the solution file in the zip file, and what's different in the project I am creating to compile the demo. Very odd. Any suggestions?

I tried doing _USE_MATH_DEFINES, and essentially copied the settings over precisely.
X-0ut
Posts: 28
Joined: Tue Oct 02, 2007 5:02 am
Contact:

Re: Build path for MSVC/Windows.

Post by X-0ut »

I went through a lot of hassle getting this to compile with visual studio 2k3, so hopefully I'll save someone else the problem.
Here is a zip containing a modified version of the 2k5 solution above, along with compiled binaries of the demo, including glut.
Chipmunkmsvc2k3
For 2k3 users, all you should have to do is open the solution hit compile and its ready to go.
Should also be compatible for 2k5 users, but the solution and project files will be modified on opening.
fictionpuss
Posts: 5
Joined: Tue Oct 02, 2007 9:22 pm
Contact:

Re: Build path for MSVC/Windows.

Post by fictionpuss »

X-0ut wrote:I went through a lot of hassle getting this to compile with visual studio 2k3, so hopefully I'll save someone else the problem.
Here is a zip containing a modified version of the 2k5 solution above, along with compiled binaries of the demo, including glut.
Chipmunkmsvc2k3
For 2k3 users, all you should have to do is open the solution hit compile and its ready to go.
Should also be compatible for 2k5 users, but the solution and project files will be modified on opening.
Thanks for this - works perfectly for me and my msvc 2k3!
Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests