Jump to content
  • Advertisement
Sign in to follow this  
Enerjak

Weird error

This topic is 3323 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

for some rerason, i get this error when i try to set the world bounds for Box2D.

error C2064: term does not evaluate to a function taking 2 arguments


is it something wrong with Box2D? or me? here is how i'm using the functions.

b2AABB World;

World.upperBound(0,0);
World.lowerBound(SCREEN_WIDTH, SCREEN_HEIGHT);


Any ideas on how to fix this error? cause to me it makes no sense. i'm not sure whether it's a Box2D error or a C++ one. so, if you can, please let me know what i can do, thanks.

Share this post


Link to post
Share on other sites
Advertisement
It looks like you want to call the b2Vec2 constructor on members upperBound and lowerBound. The compiler thinks you're trying to call a method; hence the C2064.

Try:
World.upperBound = b2Vec2(0,0);
World.lowerBound = b2Vec2(SCREEN_WIDTH, SCREEN_HEIGHT);


or look at MikeTacular's answer. [smile]

[Edited by - _fastcall on April 20, 2009 11:31:50 AM]

Share this post


Link to post
Share on other sites
that worked,thanks. now i can get about using Box2D. just that error seemed weird. anyways, thanks a bunch

Share this post


Link to post
Share on other sites
The error is not "weird"; it means exactly what it says.

term does not evaluate to a function taking 2 arguments


A "term" is a small portion of an expression, roughly speaking. Here, the term in question is "World.upperBound" or "World.lowerBound".

"Arguments" is another word for "parameters".

To "evaluate to X" means to have a result of X when evaluated. To evaluate a formula is to perform the calculation that the formula indicates.

Thus, the compiler states that selecting the upperBound member of World does not result in a function that takes two parameters. And indeed it doesn't, because the upperBound member of World is not a function that takes two parameters.

The reason it makes this complaint is that the statement "World.upperBound(0, 0)" is saying to call World.upperBound, passing it 0 and 0 as parameters. It can't do this, because World.upperBound is the wrong type.

Share this post


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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!