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

Author Topic: Problems with x64  (Read 2781 times)

0 Members and 1 Guest are viewing this topic.

LedLoaf

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Email
Problems with x64
« on: February 08, 2021, 02:58:47 am »
Hello,

So I've been trying to use the 2.5.1 x64 version and coming across these errors every time

 error C2589: '(': illegal token on right side of '::'
error C2589: '(': illegal token on right side of '::'
 

Which points to:
Rect.inl
////////////////////////////////////////////////////////////
template <typename T>
bool Rect<T>::contains(T x, T y) const
{
    // Rectangles with negative dimensions are allowed, so we must handle them correctly

    // Compute the real min and max of the rectangle on both axes
    T minX = std::min(left, static_cast<T>(left + width));
    T maxX = std::max(left, static_cast<T>(left + width));
    T minY = std::min(top, static_cast<T>(top + height));
    T maxY = std::max(top, static_cast<T>(top + height));

    return (x >= minX) && (x < maxX) && (y >= minY) && (y < maxY);
}

It's weird to me because the x86 version works just fine, as soon as I switch to the 64 it does this. It's the exact same, except for the x64 for x32 linked. I'll also point out that I'm linking statically. I don't remember ever having this problem before, so I must be doing something stupid.

Thanks

« Last Edit: February 08, 2021, 03:07:45 am by LedLoaf »

LedLoaf

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Email
Re: Problems with x64
« Reply #1 on: February 08, 2021, 03:11:46 am »
You can delete this, I'm not sure what happened, but I just redid everything and it worked.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Problems with x64
« Reply #2 on: February 08, 2021, 07:58:05 am »
It happens when you include <Windows.h> before SFML headers. It contains "min" and "max" macros, which totally ruin this kind of code using std::min and std::max. The solution is to define the "NOMINMAX" preprocessor symbol in your project.
Laurent Gomila - SFML developer