Error compiling ogre-next-deps using GCC 13

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Nucleartree
Kobold
Posts: 32
Joined: Tue Apr 04, 2017 9:10 pm
Location: Cardiff, UK
x 18

Error compiling ogre-next-deps using GCC 13

Post by Nucleartree »

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.

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5455
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1352

Re: Error compiling ogre-next-deps using GCC 13

Post by dark_sylinc »

Thanks!

It's always OpenEXR the one causing trouble!
Pushed your patch.

Nucleartree
Kobold
Posts: 32
Joined: Tue Apr 04, 2017 9:10 pm
Location: Cardiff, UK
x 18

Re: Error compiling ogre-next-deps using GCC 13

Post by Nucleartree »

Cheers! I've had a go at building this on the same system and all looks good.

But FYI sds_library, dependency of ColibriGUI (which is your fork) also needs a similar patch :wink:

Code: Select all

diff --git a/include/sds/sds_string.h b/include/sds/sds_string.h
index 11e1b51..8097c9e 100644
--- a/include/sds/sds_string.h
+++ b/include/sds/sds_string.h
@@ -6,6 +6,7 @@
 #include <map>
 #include <string>
 #include <vector>
+#include <cstdint>
 
 namespace sds
 {