Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: rect.getLocalBounds().contains errors  (Read 4139 times)

0 Members and 1 Guest are viewing this topic.

Tytan

  • Newbie
  • *
  • Posts: 12
    • View Profile
rect.getLocalBounds().contains errors
« on: November 28, 2016, 09:58:43 am »
Ok, I'm getting 8 errors and I have no clue why...
Here is the line of code that I've narrowed it down too:
if (exitRect.getGlobalBounds().contains(window.mapPixelToCoords(sf::Mouse::getPosition(window))))

And here is the db output:
>c:\users\ty\desktop\code stuff\cpp\new work\test\sfml\include\sfml\graphics\rect.inl(81): error C2589: '(': illegal token on right side of '::'
1>  c:\users\ty\desktop\code stuff\cpp\new work\test\sfml\include\sfml\graphics\rect.inl(77): note: while compiling class template member function 'bool sf::Rect<float>::contains(T,T) const'
1>          with
1>          [
1>              T=float
1>          ]
1>  c:\users\ty\desktop\code stuff\cpp\new work\test\sfml\include\sfml\graphics\rect.inl(94): note: see reference to function template instantiation 'bool sf::Rect<float>::contains(T,T) const' being compiled
1>          with
1>          [
1>              T=float
1>          ]
1>  c:\users\ty\desktop\code stuff\cpp\new work\test\sfml\include\sfml\graphics\rect.inl(40): note: while compiling class template member function 'sf::Rect<float>::Rect(T,T,T,T)'
1>          with
1>          [
1>              T=float
1>          ]
1>  c:\users\ty\desktop\code stuff\cpp\new work\test\main\main.cpp(64): note: see reference to function template instantiation 'sf::Rect<float>::Rect(T,T,T,T)' being compiled
1>          with
1>          [
1>              T=float
1>          ]
1>  c:\users\ty\desktop\code stuff\cpp\new work\test\sfml\include\sfml\graphics\shape.hpp(315): note: see reference to class template instantiation 'sf::Rect<float>' being compiled
1>c:\users\ty\desktop\code stuff\cpp\new work\testclient\sfml\include\sfml\graphics\rect.inl(81): error C2059: syntax error: '::'
1>c:\users\ty\desktop\code stuff\cpp\new work\test\sfml\include\sfml\graphics\rect.inl(82): error C2589: '(': illegal token on right side of '::'
1>c:\users\ty\desktop\code stuff\cpp\new work\test\sfml\include\sfml\graphics\rect.inl(82): error C2059: syntax error: '::'
1>c:\users\ty\desktop\code stuff\cpp\new work\test\sfml\include\sfml\graphics\rect.inl(83): error C2589: '(': illegal token on right side of '::'
1>c:\users\ty\desktop\code stuff\cpp\new work\test\sfml\include\sfml\graphics\rect.inl(83): error C2059: syntax error: '::'
1>c:\users\ty\desktop\code stuff\cpp\new work\test\sfml\include\sfml\graphics\rect.inl(84): error C2589: '(': illegal token on right side of '::'
1>c:\users\ty\desktop\code stuff\cpp\new work\test\sfml\include\sfml\graphics\rect.inl(84): error C2059: syntax error: '::'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
 

If you would want more information, just tell me  :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: rect.getLocalBounds().contains errors
« Reply #1 on: November 28, 2016, 10:15:37 am »
You most likely include (something that includes) <windows.h> before SFML headers. Several possible solutions:
- get rid of that include if you don't need it
- define the preprocessor symbol NOMINMAX in your project settings
- #undef "min" and "max" symbols immediatly after including windows.h
- do not include any SFML header after windows.h, if possible

solution #2 is the cleanest (or #1 if you have windows.h included just for fun).
Laurent Gomila - SFML developer

Tytan

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: rect.getLocalBounds().contains errors
« Reply #2 on: November 28, 2016, 10:32:44 am »
Awesome! That fixed it instantly :D
Thanks!