Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Math.Polygon] INT64_MAX not known in newer GCC versions #2

Open
GWRon opened this issue Feb 23, 2024 · 2 comments
Open

[Math.Polygon] INT64_MAX not known in newer GCC versions #2

GWRon opened this issue Feb 23, 2024 · 2 comments

Comments

@GWRon
Copy link

GWRon commented Feb 23, 2024

As William in discord pointed out he is not able to compile math.polygon.

I now installed ubuntu 23.10 in a VM and tried to compile math.polygon too:
(using gcc version 13.2.0 (Ubuntu 13.2.0-4ubuntu3))

[ 57%] Compiling:clipper.rectclip.cpp
In file included from /home/ronny/Downloads/BlitzMax_linux_x64_0.143.3.57.202402180135/BlitzMax/mod/math.mod/polygon.mod/clipper2/CPP/Clipper2Lib/include/clipper2/clipper.h:16,
                 from /home/ronny/Downloads/BlitzMax_linux_x64_0.143.3.57.202402180135/BlitzMax/mod/math.mod/polygon.mod/clipper2/CPP/Clipper2Lib/src/clipper.offset.cpp:11:
/home/ronny/Downloads/BlitzMax_linux_x64_0.143.3.57.202402180135/BlitzMax/mod/math.mod/polygon.mod/clipper2/CPP/Clipper2Lib/include/clipper2/clipper.core.h:29:36: error: �INT64_MAX� was not declared in this scope
   29 |   static const int64_t MAX_COORD = INT64_MAX >> 2;
      |                                    ^~~~~~~~~
/home/ronny/Downloads/BlitzMax_linux_x64_0.143.3.57.202402180135/BlitzMax/mod/math.mod/polygon.mod/clipper2/CPP/Clipper2Lib/include/clipper2/clipper.core.h:20:1: note: �INT64_MAX� is defined in header �<cstdint>�; did you forget to �#include <cstdint>�?
   19 | #include <climits>
  +++ |+#include <cstdint>
   20 | 
/home/ronny/Downloads/BlitzMax_linux_x64_0.143.3.57.202402180135/BlitzMax/mod/math.mod/polygon.mod/clipper2/CPP/Clipper2Lib/include/clipper2/clipper.core.h:31:34: error: �INT64_MAX� was not declared in this scope
   31 |   static const int64_t INVALID = INT64_MAX;
      |                                  ^~~~~~~~~
/home/ronny/Downloads/BlitzMax_linux_x64_0.143.3.57.202402180135/BlitzMax/mod/math.mod/polygon.mod/clipper2/CPP/Clipper2Lib/include/clipper2/clipper.core.h:31:34: note: �INT64_MAX� is defined in header �<cstdint>�; did you forget to �#include <cstdint>�?
Build Error: failed to compile (256) /home/ronny/Downloads/BlitzMax_linux_x64_0.143.3.57.202402180135/BlitzMax/mod/math.mod/polygon.mod/clipper2/CPP/Clipper2Lib/src/clipper.offset.cpp
Process complete

Seems for newer GCCs we need to include something more - or a newer version of the lib might already be aware of the issue.

@GWRon
Copy link
Author

GWRon commented Feb 23, 2024

i added

#include <stdint.h>

(alternatively do #include <cstdint> as the error message indicates :D)

to math.mod/polygon.mod/clipper2/CPP/Clipper2Lib/include/clipper2/clipper.core.h
and then it compiled - but am not sure if that is feasible for non-linux.

@GWRon
Copy link
Author

GWRon commented Feb 24, 2024

Updating to the latest clipper should resolve that issue:
https://github.com/AngusJohnson/Clipper2

The fix was introduced there with this commit:
AngusJohnson/Clipper2@742614f

which indicates the issue begins with GCC13 (and later).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant