Hi everyone. I recently tried to build ogre-next-deps on my arch linux setup. Arch being rolling release and therefore having a newer version of GCC I noticed a compiler error when building free image.
Code: Select all
In file included from /home/edward/build/ogre-next-deps/src/FreeImage/Source/OpenEXR/OpenEXR/ImfDeepTiledInputFile.cpp:12:
/home/edward/build/ogre-next-deps/src/FreeImage/Source/OpenEXR/OpenEXR/ImfDeepTiledInputFile.h:358:38: error: uint64_t has not been declared
358 | uint64_t &dataSize) const;
From doing some digging this seems to be related to a change in GCC, where you now have to explicitly define #include <cstdint>, as per this PR to OpenEXR, which is used by free image https://github.com/AcademySoftwareFound ... 1264/files However for some reason our copy/paste of this into ogre-next-deps doesn’t include this change, even though it was only updated by DarkSylinc a few months ago:
Ours: https://github.com/OGRECave/ogre-next-d ... nputFile.h
Theirs: https://github.com/AcademySoftwareFound ... nputFile.h
I was able to fix this with this change:
Code: Select all
diff --git a/src/FreeImage/Source/OpenEXR/OpenEXR/ImfDeepTiledInputFile.h b/src/FreeImage/Source/OpenEXR/OpenEXR/ImfDeepTiledInputFile.h
index b01330f..ac8161e 100644
--- a/src/FreeImage/Source/OpenEXR/OpenEXR/ImfDeepTiledInputFile.h
+++ b/src/FreeImage/Source/OpenEXR/OpenEXR/ImfDeepTiledInputFile.h
@@ -14,6 +14,8 @@
#include "ImfForward.h"
+#include <cstdint>
+
#include "ImfThreading.h"
#include "ImfGenericInputFile.h"
diff --git a/src/FreeImage/Source/OpenEXR/OpenEXR/ImfDeepTiledInputPart.h b/src/FreeImage/Source/OpenEXR/OpenEXR/ImfDeepTiledInputPart.h
index e5f950a..d1442cf 100644
--- a/src/FreeImage/Source/OpenEXR/OpenEXR/ImfDeepTiledInputPart.h
+++ b/src/FreeImage/Source/OpenEXR/OpenEXR/ImfDeepTiledInputPart.h
@@ -10,6 +10,8 @@
#include "ImfTileDescription.h"
+#include <cstdint>
+
#include <ImathBox.h>
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
diff --git a/src/FreeImage/Source/OpenEXR/OpenEXR/ImfTiledMisc.h b/src/FreeImage/Source/OpenEXR/OpenEXR/ImfTiledMisc.h
index 9059ae2..9c01614 100644
--- a/src/FreeImage/Source/OpenEXR/OpenEXR/ImfTiledMisc.h
+++ b/src/FreeImage/Source/OpenEXR/OpenEXR/ImfTiledMisc.h
@@ -19,7 +19,7 @@
#include <stdio.h>
#include <vector>
-
+#include <cstdint>
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
I have tested this using a series of Docker containers as well. Ubuntu 20.04 can build the dependencies without issues, however Ubuntu latest, which is 24.04 cannot. I believe this is due to the include requirement.