I'm packaging fs2_open for Gentoo, but with the recent release 24_0_0 there are compilation errors which I can't seem to solve by myself. The relevant bit in the output is this:
In file included from /var/tmp/portage/games-engines/fs2_open-24.0.0/work/fs2open.github.com-release_24_0_0/code/cmdline/cmdline.cpp:10:
/var/tmp/portage/games-engines/fs2_open-24.0.0/work/fs2open.github.com-release_24_0_0/code/cmdline/cmdline.h:50:31: error: ‘uint16_t’ was not declared in this scope
50 | extern tl::optional<std::pair<uint16_t, uint16_t>>Cmdline_window_res;
| ^~~~~~~~
/var/tmp/portage/games-engines/fs2_open-24.0.0/work/fs2open.github.com-release_24_0_0/code/cmdline/cmdline.h:16:1: note: ‘uint16_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
15 | #include <tl/optional.hpp>
+++ |+#include <cstdint>
16 |
/var/tmp/portage/games-engines/fs2_open-24.0.0/work/fs2open.github.com-release_24_0_0/code/cmdline/cmdline.h:50:41: error: ‘uint16_t’ was not declared in this scope
50 | extern tl::optional<std::pair<uint16_t, uint16_t>>Cmdline_window_res;
| ^~~~~~~~
/var/tmp/portage/games-engines/fs2_open-24.0.0/work/fs2open.github.com-release_24_0_0/code/cmdline/cmdline.h:50:41: note: ‘uint16_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
/var/tmp/portage/games-engines/fs2_open-24.0.0/work/fs2open.github.com-release_24_0_0/code/cmdline/cmdline.h:50:41: error: template argument 1 is invalid
/var/tmp/portage/games-engines/fs2_open-24.0.0/work/fs2open.github.com-release_24_0_0/code/cmdline/cmdline.h:50:41: error: template argument 2 is invalid
/var/tmp/portage/games-engines/fs2_open-24.0.0/work/fs2open.github.com-release_24_0_0/code/cmdline/cmdline.h:50:49: error: template argument 1 is invalid
50 | extern tl::optional<std::pair<uint16_t, uint16_t>>Cmdline_window_res;
| ^~
/var/tmp/portage/games-engines/fs2_open-24.0.0/work/fs2open.github.com-release_24_0_0/code/cmdline/cmdline.h:111:8: error: ‘SCP_string’ does not name a type
111 | extern SCP_string Cmdline_lang;
| ^~~~~~~~~~
/var/tmp/portage/games-engines/fs2_open-24.0.0/work/fs2open.github.com-release_24_0_0/code/cmdline/cmdline.cpp:564:44: error: conflicting declaration ‘tl::optional<std::pair<short unsigned int, short unsigned int> > Cmdline_window_res’
564 | tl::optional<std::pair<uint16_t, uint16_t>>Cmdline_window_res = tl::nullopt;
| ^~~~~~~~~~~~~~~~~~
/var/tmp/portage/games-engines/fs2_open-24.0.0/work/fs2open.github.com-release_24_0_0/code/cmdline/cmdline.h:50:51: note: previous declaration as ‘int Cmdline_window_res’
50 | extern tl::optional<std::pair<uint16_t, uint16_t>>Cmdline_window_res;
| ^~~~~~~~~~~~~~~~~~
/var/tmp/portage/games-engines/fs2_open-24.0.0/work/fs2open.github.com-release_24_0_0/code/cmdline/cmdline.cpp: In function ‘bool SetCmdlineParams()’:
/var/tmp/portage/games-engines/fs2_open-24.0.0/work/fs2open.github.com-release_24_0_0/code/cmdline/cmdline.cpp:1803:44: error: request for member ‘emplace’ in ‘Cmdline_window_res’, which is of non-class type ‘int’
1803 | Cmdline_window_res.emplace(static_cast<uint16_t>(width), static_cast<uint16_t>(height));
| ^~~~~~~
Full log see: https://paste.gentoo.zip/SuScYBnr
I tried to build with gcc and clang, both fail at the same position.
This issue may be specific to Portage, because if I just run cmake ../ and make, there are only a few warnings but no errors. But I never had this issue with older releases, they build fine with Portage. Any hints as to where the issue could be?
I'm packaging fs2_open for Gentoo, but with the recent release 24_0_0 there are compilation errors which I can't seem to solve by myself. The relevant bit in the output is this:
Full log see: https://paste.gentoo.zip/SuScYBnr
I tried to build with
gccandclang, both fail at the same position.This issue may be specific to Portage, because if I just run
cmake ../andmake, there are only a few warnings but no errors. But I never had this issue with older releases, they build fine with Portage. Any hints as to where the issue could be?