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

OpenRCT2 won't build with GCC 14 #22029

Closed
solarisfire opened this issue May 13, 2024 · 1 comment · Fixed by #22031
Closed

OpenRCT2 won't build with GCC 14 #22029

solarisfire opened this issue May 13, 2024 · 1 comment · Fixed by #22031
Labels
bug Something went wrong. build Pertains to compilation, language standard, external dependencies.

Comments

@solarisfire
Copy link

Operating System

Arch Linux

OpenRCT2 build

0.4.11.r77.g6df16c7946-1

Base game

RollerCoaster Tycoon 2

Area(s) with this issue?

This is a development issue

Describe the issue

When GCC14 is installed and used to compile OpenRCT2, the code will not build.

It will throw errors like:

/usr/bin/c++ -DDOCDIR=\"/usr/share/doc/openrct2\" -DOPENGL_NO_LINK -D_FILE_OFFSET_BITS=64 -D__ENABLE_DISCORD__ -I/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/DISCORDRPC_PROCESS_INCLUDES -I/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/../thirdparty/duktape -I/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/libopenrct2 -isystem /usr/include/freetype2 -isystem /usr/include/libpng16 -isystem /usr/include/harfbuzz -isystem /usr/include/glib-2.0 -isystem /usr/lib/glib-2.0/include -isystem /usr/include/sysprof-6 -isystem /home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/../thirdparty -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -Wno-error=maybe-uninitialized  -Wno-error=restrict  -Wno-error=null-dereference  -Wno-error=stringop-overflow -fstrict-overflow -fstrict-aliasing -Werror -Wundef -Wmissing-declarations -Winit-self -Wall -Wextra -Wshadow -Wno-unknown-pragmas -Wno-missing-braces -Wno-comment -Wnonnull -Wno-unused-parameter -Wno-attributes -DDEBUG=0 -fno-char8_t -Wno-deprecated-declarations -O2 -g -DNDEBUG -std=gnu++20 -fPIC -Wsuggest-override -Wduplicated-cond -Wnon-virtual-dtor -Wduplicated-branches -Wrestrict -Wmissing-field-initializers -Wlogical-op -Wold-style-cast -Wunused-const-variable=1 -Wno-clobbered -Wredundant-decls -Wnull-dereference -Wignored-qualifiers -Wstrict-overflow=1 -DENABLE_SCRIPTING -pthread -MD -MT CMakeFiles/libopenrct2.dir/src/openrct2/actions/GameActionRegistry.cpp.o -MF CMakeFiles/libopenrct2.dir/src/openrct2/actions/GameActionRegistry.cpp.o.d -o CMakeFiles/libopenrct2.dir/src/openrct2/actions/GameActionRegistry.cpp.o -c /home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/actions/GameActionRegistry.cpp
/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/actions/../ride/../paint/Paint.h:76:33: error: no matching function for call to ‘max()’
/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/actions/../ride/../paint/Paint.h:76:114: error: template argument 2 is invalid
/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/actions/../ride/../paint/Paint.h:76:10: error: ‘’ in namespace ‘std’ does not name a type
/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/actions/../ride/../paint/Paint.h:81:52: error: ‘data’ was not declared in this scope
/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/actions/../ride/../paint/Paint.h:87:60: error: ‘data’ was not declared in this scope
/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/actions/../ride/../paint/Paint.h:93:58: error: ‘data’ was not declared in this scope
/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/actions/../ride/../paint/Paint.h:98:34: error: static assertion failed
/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/actions/../ride/../paint/Paint.h:99:34: error: static assertion failed
/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/actions/../ride/../paint/Paint.h:100:34: error: static assertion failed
FAILED: CMakeFiles/libopenrct2.dir/src/openrct2/actions/LandSmoothAction.cpp.o 
/usr/bin/c++ -DDOCDIR=\"/usr/share/doc/openrct2\" -DOPENGL_NO_LINK -D_FILE_OFFSET_BITS=64 -D__ENABLE_DISCORD__ -I/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/DISCORDRPC_PROCESS_INCLUDES -I/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/../thirdparty/duktape -I/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/libopenrct2 -isystem /usr/include/freetype2 -isystem /usr/include/libpng16 -isystem /usr/include/harfbuzz -isystem /usr/include/glib-2.0 -isystem /usr/lib/glib-2.0/include -isystem /usr/include/sysprof-6 -isystem /home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/../thirdparty -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -Wno-error=maybe-uninitialized  -Wno-error=restrict  -Wno-error=null-dereference  -Wno-error=stringop-overflow -fstrict-overflow -fstrict-aliasing -Werror -Wundef -Wmissing-declarations -Winit-self -Wall -Wextra -Wshadow -Wno-unknown-pragmas -Wno-missing-braces -Wno-comment -Wnonnull -Wno-unused-parameter -Wno-attributes -DDEBUG=0 -fno-char8_t -Wno-deprecated-declarations -O2 -g -DNDEBUG -std=gnu++20 -fPIC -Wsuggest-override -Wduplicated-cond -Wnon-virtual-dtor -Wduplicated-branches -Wrestrict -Wmissing-field-initializers -Wlogical-op -Wold-style-cast -Wunused-const-variable=1 -Wno-clobbered -Wredundant-decls -Wnull-dereference -Wignored-qualifiers -Wstrict-overflow=1 -DENABLE_SCRIPTING -pthread -MD -MT CMakeFiles/libopenrct2.dir/src/openrct2/actions/LandSmoothAction.cpp.o -MF CMakeFiles/libopenrct2.dir/src/openrct2/actions/LandSmoothAction.cpp.o.d -o CMakeFiles/libopenrct2.dir/src/openrct2/actions/LandSmoothAction.cpp.o -c /home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/actions/LandSmoothAction.cpp
/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/actions/../ride/../paint/Paint.h:76:33: error: no matching function for call to ‘max()’
/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/actions/../ride/../paint/Paint.h:76:114: error: template argument 2 is invalid
/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/actions/../ride/../paint/Paint.h:76:10: error: ‘’ in namespace ‘std’ does not name a type
/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/actions/../ride/../paint/Paint.h:81:52: error: ‘data’ was not declared in this scope
/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/actions/../ride/../paint/Paint.h:87:60: error: ‘data’ was not declared in this scope
/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/actions/../ride/../paint/Paint.h:93:58: error: ‘data’ was not declared in this scope
/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/actions/../ride/../paint/Paint.h:98:34: error: static assertion failed
/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/actions/../ride/../paint/Paint.h:99:34: error: static assertion failed
/home/solarisfire/.cache/yay/openrct2-git/src/openrct2-git/src/openrct2/actions/../ride/../paint/Paint.h:100:34: error: static assertion failed
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in build().

Steps to reproduce

Install GCC14.
Try and build OpenRCT2.

Attachments

No response

@solarisfire solarisfire added the bug Something went wrong. label May 13, 2024
@Gymnasiast
Copy link
Member

Caused by Paint.h using std::max(), which is defined in <algorithm> and no longer included.

@Gymnasiast Gymnasiast added the build Pertains to compilation, language standard, external dependencies. label May 13, 2024
janisozaur added a commit to janisozaur/OpenRCT2 that referenced this issue May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something went wrong. build Pertains to compilation, language standard, external dependencies.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants