SFML community forums

Help => General => Topic started by: Pwishie on April 24, 2017, 04:35:52 am

Title: Collision Problem
Post by: Pwishie on April 24, 2017, 04:35:52 am
Accidentally posted this on the wrong board earlier today.  Sorry about that

I keep getting strange error from Visual Studio when I try to add collision detection to my game.  There errors all look like similar to this:
"...sfml\graphics\rect.inl(114): error C2589: '(': illegal token on right side of '::'"
I'm doing collision detection in the exact same way I've always done it, and trying other methods doesn't work either. 
Relevant Code:
if (isCollide(spr, spr2)) {
                        std::cout << "You win!!!! \n";
                }
bool isCollide(sf::Sprite spr1, sf::Sprite spr2) {
        return spr1.getGlobalBounds().intersects(spr2.getGlobalBounds());
}
 

I was wondering if it's an issue with how I set up SFML in VS...
Title: Re: Collision Problem
Post by: Laurent on April 24, 2017, 06:32:49 am
If you include windows.h (directly or indirectly), then either do it after everything else, or define the NOMINMAX symbol in your preprocessor options.