Box2D Forums

It is currently Sat May 25, 2013 9:11 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Thu Nov 15, 2007 3:27 am 
Offline

Joined: Thu Nov 15, 2007 3:23 am
Posts: 24
hey there!

first of all: thank you for creating this framework! it seems to be pretty useful! :)

i tried to use your stuff in visual studio 6.0. i created an empty console application and inserted your "hello world"-code. i set the include path to your box2d-include directory, but when i try to compile i get a load of errors - all located in b2math.h:

Quote:
d:\silver\zodiac\box2d_v1.4.2\box2d\source\common\b2math.h(276) : error C2782: 'T __cdecl b2Min(T,T)' : template parameter 'T' is ambiguous
could be 'struct b2Vec2'
or 'const struct b2Vec2 &'
d:\silver\zodiac\box2d_v1.4.2\box2d\source\common\b2math.h(276) : error C2785: 'T __cdecl b2Min(T,T)' and 'struct b2Vec2 __cdecl b2Min(const struct b2Vec2 &,const struct b2Vec2 &)' have different return types
d:\silver\zodiac\box2d_v1.4.2\box2d\source\common\b2math.h(270) : see declaration of 'b2Min'
d:\silver\zodiac\box2d_v1.4.2\box2d\source\common\b2math.h(290) : error C2782: 'T __cdecl b2Max(T,T)' : template parameter 'T' is ambiguous
could be 'struct b2Vec2'
or 'const struct b2Vec2 &'
d:\silver\zodiac\box2d_v1.4.2\box2d\source\common\b2math.h(290) : error C2785: 'T __cdecl b2Max(T,T)' and 'struct b2Vec2 __cdecl b2Max(const struct b2Vec2 &,const struct b2Vec2 &)' have different return types
d:\silver\zodiac\box2d_v1.4.2\box2d\source\common\b2math.h(284) : see declaration of 'b2Max'
d:\silver\zodiac\box2d_v1.4.2\box2d\source\common\b2math.h(304) : error C2782: 'T __cdecl b2Clamp(T,T,T)' : template parameter 'T' is ambiguous
could be 'struct b2Vec2'
or 'const struct b2Vec2 &'
d:\silver\zodiac\box2d_v1.4.2\box2d\source\common\b2math.h(304) : error C2785: 'T __cdecl b2Clamp(T,T,T)' and 'struct b2Vec2 __cdecl b2Clamp(const struct b2Vec2 &,const struct b2Vec2 &,const struct b2Vec2 &)' have different return types
d:\silver\zodiac\box2d_v1.4.2\box2d\source\common\b2math.h(298) : see declaration of 'b2Clamp'



any insights would be helpful! :)


Top
 Profile  
 
PostPosted: Thu Nov 15, 2007 4:09 am 
Offline

Joined: Thu Nov 15, 2007 3:23 am
Posts: 24
seems like projects in visual studio 6.0 don't compile if there are functions with the same name in a class.

i don't know if this is the best way, but i just replaced a few things in b2math.h

Quote:
inline b2Vec2 b2Max(const b2Vec2& a, const b2Vec2& b)
inline b2Vec2 b2Min(const b2Vec2& a, const b2Vec2& b)
inline b2Vec2 b2Clamp(const b2Vec2& a, const b2Vec2& low, const b2Vec2& high)


became

Quote:
inline b2Vec2 b2MaxVec(const b2Vec2& a, const b2Vec2& b)
inline b2Vec2 b2MinVec(const b2Vec2& a, const b2Vec2& b)
inline b2Vec2 b2ClampVec(const b2Vec2& a, const b2Vec2& low, const b2Vec2& high)


(of course i edited all calls using inline-functions with b2vec2-objects)

now it compiles, but i guess i'm still missing some .lib-files, because now i get unresolved externals on the b2world-object...


Top
 Profile  
 
PostPosted: Thu Nov 15, 2007 11:30 am 
Offline
Site Admin

Joined: Thu Sep 06, 2007 12:34 am
Posts: 2931
Sorry, I'm not supporting vc6. You can download free versions of vc8 and vc9. vc9 comes with the platform SDK.


Top
 Profile  
 
PostPosted: Thu Nov 15, 2007 11:33 am 
Offline

Joined: Tue Sep 11, 2007 7:26 am
Posts: 95
Also codeblocks works great!
Free like vc8..
Mike


Top
 Profile  
 
PostPosted: Fri Nov 16, 2007 1:19 am 
Offline

Joined: Thu Nov 15, 2007 3:23 am
Posts: 24
Erin Catto wrote:
Sorry, I'm not supporting vc6. You can download free versions of vc8 and vc9. vc9 comes with the platform SDK.

no problem. i rebuilt box2d using vc6 and now i'm using the created library and it works. ;)


Top
 Profile  
 
PostPosted: Fri Nov 16, 2007 4:02 am 
Offline

Joined: Tue Sep 11, 2007 7:26 am
Posts: 95
Hey thats great!
How did you get it working? I wouldn't mind going back to
VS6. Codeblocks is nice but i still prefer the VS6 environment.
Mike


Top
 Profile  
 
PostPosted: Fri Nov 16, 2007 4:16 am 
Offline

Joined: Thu Nov 15, 2007 3:23 am
Posts: 24
mike950 wrote:
Hey thats great!
How did you get it working? I wouldn't mind going back to
VS6. Codeblocks is nice but i still prefer the VS6 environment.
Mike

i created a new library-project, added all the files of box2d (header and all the source files), did the above mentioned changes in 2dmath.h, compiled and used the created .lib-file in my project. works! :)


Top
 Profile  
 
PostPosted: Fri Nov 16, 2007 7:08 am 
Offline

Joined: Tue Sep 11, 2007 7:26 am
Posts: 95
Excellent! Thanks..
I'm switching to vs6 now :)
Mike


Top
 Profile  
 
PostPosted: Thu Dec 27, 2007 8:24 am 
Offline

Joined: Thu Dec 27, 2007 8:03 am
Posts: 5
Hi, I just wanted to point out that an easier way is to just edit the template functions like so:

Code:
template <typename T>
//inline T b2Min(T a, T b)
inline T b2Min(const T &a, const T &b)

template <typename T>
//inline T b2Max(T a, T b)
inline T b2Max(const T &a, const T &b)

template <typename T>
//inline T b2Clamp(T a, T low, T high)
inline T b2Clamp(const T &a, const T &low, const T &high)


Now you don't have to edit all the code that calls these functions. Hope that helps someone!

-j


Top
 Profile  
 
PostPosted: Thu Dec 27, 2007 9:35 am 
Offline

Joined: Tue Sep 11, 2007 7:26 am
Posts: 95
Thanks!
What a great tip!
Mike


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group