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

SDL 2.0.18: Build error: 'KMOD_RESERVED' undeclared (first use in this function) #1682

Open
shoober420 opened this issue Aug 13, 2021 · 9 comments
Labels
cat: client Category engine (client, renderer, sdl) P2: High Priority 2 📝 Task Indirectly related to code: libs update, documentation
Milestone

Comments

@shoober420
Copy link

shoober420 commented Aug 13, 2021

I'm trying to compile etlegacy from current git master as of this post (fce82a4), and experience an error during compilation on Gentoo Linux with GCC 11.2. Here is a snippet of the error. full log also attached.

etlegacybuild.log

[115/322] /usr/bin/x86_64-pc-linux-gnu-g++ -DDEFAULT_BASEDIR=\"/usr/share/etlegacy\" -DFEATURE_ANTICHEAT -DFEATURE_DBMS -DFEATURE_EDV -DFEATURE_FREETYPE -DFEATURE_GETTEXT -DFEATURE_MULTIVIEW -DFEATURE_OPENAL -DFEATURE_OPENAL_DLOPEN -DFEATURE_PAKISOLATION -DFEATURE_PNG -DFEATURE_PRESTIGE -DFEATURE_RATING -DFEATURE_SSL -DHAVE_SDL -DUSE_ICON -DUSE_RENDERER_DLOPEN -DUSING_OPENSSL -I/var/tmp/portage/games-fps/etlegacy-9999/work/etlegacy-9999_build/include -isystem /usr/include/SDL2 -isystem /usr/include/freetype2 -isystem /usr/include/AL -isystem /usr/include/minizip  -march=native -Ofast -pipe -fno-plt -fno-common -fno-semantic-interposition -fipa-pta -falign-functions=32 -fdevirtualize-at-ltrans -fuse-linker-plugin -floop-nest-optimize -fgraphite-identity -fno-signed-zeros -fno-trapping-math -fassociative-math -freciprocal-math -fno-math-errno -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fcx-limited-range -fexcess-precision=fast -w -flto=auto -fdiagnostics-color=always -std=gnu++11 -MD -MT CMakeFiles/etl.dir/src/tinygettext/iconv.cpp.o -MF CMakeFiles/etl.dir/src/tinygettext/iconv.cpp.o.d -o CMakeFiles/etl.dir/src/tinygettext/iconv.cpp.o -c /var/tmp/portage/games-fps/etlegacy-9999/work/etlegacy-9999/src/tinygettext/iconv.cpp
[116/322] /usr/bin/x86_64-pc-linux-gnu-gcc -DDEFAULT_BASEDIR=\"/usr/share/etlegacy\" -DFEATURE_ANTICHEAT -DFEATURE_DBMS -DFEATURE_EDV -DFEATURE_FREETYPE -DFEATURE_GETTEXT -DFEATURE_MULTIVIEW -DFEATURE_OPENAL -DFEATURE_OPENAL_DLOPEN -DFEATURE_PAKISOLATION -DFEATURE_PNG -DFEATURE_PRESTIGE -DFEATURE_RATING -DFEATURE_SSL -DHAVE_SDL -DUSE_ICON -DUSE_RENDERER_DLOPEN -DUSING_OPENSSL -I/var/tmp/portage/games-fps/etlegacy-9999/work/etlegacy-9999_build/include -isystem /usr/include/SDL2 -isystem /usr/include/freetype2 -isystem /usr/include/AL -isystem /usr/include/minizip  -march=native -Ofast -pipe -fno-plt -fno-common -fno-semantic-interposition -fipa-pta -falign-functions=32 -fdevirtualize-at-ltrans -fuse-linker-plugin -floop-nest-optimize -fgraphite-identity -fno-signed-zeros -fno-trapping-math -fassociative-math -freciprocal-math -fno-math-errno -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fcx-limited-range -fexcess-precision=fast -w -flto=auto -fdiagnostics-color=always -fvisibility=hidden -std=gnu99 -MD -MT CMakeFiles/etl.dir/src/qcommon/dl_main_curl.c.o -MF CMakeFiles/etl.dir/src/qcommon/dl_main_curl.c.o.d -o CMakeFiles/etl.dir/src/qcommon/dl_main_curl.c.o -c /var/tmp/portage/games-fps/etlegacy-9999/work/etlegacy-9999/src/qcommon/dl_main_curl.c
[117/322] /usr/bin/x86_64-pc-linux-gnu-gcc -DDEFAULT_BASEDIR=\"/usr/share/etlegacy\" -DFEATURE_ANTICHEAT -DFEATURE_DBMS -DFEATURE_EDV -DFEATURE_FREETYPE -DFEATURE_GETTEXT -DFEATURE_MULTIVIEW -DFEATURE_OPENAL -DFEATURE_OPENAL_DLOPEN -DFEATURE_PAKISOLATION -DFEATURE_PNG -DFEATURE_PRESTIGE -DFEATURE_RATING -DFEATURE_SSL -DHAVE_SDL -DUSE_ICON -DUSE_RENDERER_DLOPEN -DUSING_OPENSSL -I/var/tmp/portage/games-fps/etlegacy-9999/work/etlegacy-9999_build/include -isystem /usr/include/SDL2 -isystem /usr/include/freetype2 -isystem /usr/include/AL -isystem /usr/include/minizip  -march=native -Ofast -pipe -fno-plt -fno-common -fno-semantic-interposition -fipa-pta -falign-functions=32 -fdevirtualize-at-ltrans -fuse-linker-plugin -floop-nest-optimize -fgraphite-identity -fno-signed-zeros -fno-trapping-math -fassociative-math -freciprocal-math -fno-math-errno -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fcx-limited-range -fexcess-precision=fast -w -flto=auto -fdiagnostics-color=always -fvisibility=hidden -std=gnu99 -MD -MT CMakeFiles/etl.dir/src/sys/con_tty.c.o -MF CMakeFiles/etl.dir/src/sys/con_tty.c.o.d -o CMakeFiles/etl.dir/src/sys/con_tty.c.o -c /var/tmp/portage/games-fps/etlegacy-9999/work/etlegacy-9999/src/sys/con_tty.c
[118/322] /usr/bin/x86_64-pc-linux-gnu-gcc -DCGAMEDLL=1 -DDEFAULT_BASEDIR=\"/usr/share/etlegacy\" -DFEATURE_ANTICHEAT -DFEATURE_DBMS -DFEATURE_EDV -DFEATURE_FREETYPE -DFEATURE_GETTEXT -DFEATURE_MULTIVIEW -DFEATURE_OPENAL -DFEATURE_OPENAL_DLOPEN -DFEATURE_PAKISOLATION -DFEATURE_PNG -DFEATURE_PRESTIGE -DFEATURE_RATING -DFEATURE_SSL -DHAVE_SDL -DMODLIB=1 -DUSE_RENDERER_DLOPEN -DUSING_OPENSSL -Dcgame_EXPORTS -I/var/tmp/portage/games-fps/etlegacy-9999/work/etlegacy-9999_build/include -isystem /usr/include/SDL2 -isystem /usr/include/freetype2 -isystem /usr/include/AL -isystem /usr/include/minizip  -march=native -Ofast -pipe -fno-plt -fno-common -fno-semantic-interposition -fipa-pta -falign-functions=32 -fdevirtualize-at-ltrans -fuse-linker-plugin -floop-nest-optimize -fgraphite-identity -fno-signed-zeros -fno-trapping-math -fassociative-math -freciprocal-math -fno-math-errno -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fcx-limited-range -fexcess-precision=fast -w -flto=auto -fdiagnostics-color=always -fvisibility=hidden -fPIC -std=gnu90 -MD -MT CMakeFiles/cgame.dir/src/cgame/cg_camera.c.o -MF CMakeFiles/cgame.dir/src/cgame/cg_camera.c.o.d -o CMakeFiles/cgame.dir/src/cgame/cg_camera.c.o -c /var/tmp/portage/games-fps/etlegacy-9999/work/etlegacy-9999/src/cgame/cg_camera.c
[119/322] /usr/bin/x86_64-pc-linux-gnu-gcc -DCGAMEDLL=1 -DDEFAULT_BASEDIR=\"/usr/share/etlegacy\" -DFEATURE_ANTICHEAT -DFEATURE_DBMS -DFEATURE_EDV -DFEATURE_FREETYPE -DFEATURE_GETTEXT -DFEATURE_MULTIVIEW -DFEATURE_OPENAL -DFEATURE_OPENAL_DLOPEN -DFEATURE_PAKISOLATION -DFEATURE_PNG -DFEATURE_PRESTIGE -DFEATURE_RATING -DFEATURE_SSL -DHAVE_SDL -DMODLIB=1 -DUSE_RENDERER_DLOPEN -DUSING_OPENSSL -Dcgame_EXPORTS -I/var/tmp/portage/games-fps/etlegacy-9999/work/etlegacy-9999_build/include -isystem /usr/include/SDL2 -isystem /usr/include/freetype2 -isystem /usr/include/AL -isystem /usr/include/minizip  -march=native -Ofast -pipe -fno-plt -fno-common -fno-semantic-interposition -fipa-pta -falign-functions=32 -fdevirtualize-at-ltrans -fuse-linker-plugin -floop-nest-optimize -fgraphite-identity -fno-signed-zeros -fno-trapping-math -fassociative-math -freciprocal-math -fno-math-errno -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fcx-limited-range -fexcess-precision=fast -w -flto=auto -fdiagnostics-color=always -fvisibility=hidden -fPIC -std=gnu90 -MD -MT CMakeFiles/cgame.dir/src/cgame/cg_character.c.o -MF CMakeFiles/cgame.dir/src/cgame/cg_character.c.o.d -o CMakeFiles/cgame.dir/src/cgame/cg_character.c.o -c /var/tmp/portage/games-fps/etlegacy-9999/work/etlegacy-9999/src/cgame/cg_character.c
[120/322] /usr/bin/x86_64-pc-linux-gnu-gcc -DCGAMEDLL=1 -DDEFAULT_BASEDIR=\"/usr/share/etlegacy\" -DFEATURE_ANTICHEAT -DFEATURE_DBMS -DFEATURE_EDV -DFEATURE_FREETYPE -DFEATURE_GETTEXT -DFEATURE_MULTIVIEW -DFEATURE_OPENAL -DFEATURE_OPENAL_DLOPEN -DFEATURE_PAKISOLATION -DFEATURE_PNG -DFEATURE_PRESTIGE -DFEATURE_RATING -DFEATURE_SSL -DHAVE_SDL -DMODLIB=1 -DUSE_RENDERER_DLOPEN -DUSING_OPENSSL -Dcgame_EXPORTS -I/var/tmp/portage/games-fps/etlegacy-9999/work/etlegacy-9999_build/include -isystem /usr/include/SDL2 -isystem /usr/include/freetype2 -isystem /usr/include/AL -isystem /usr/include/minizip  -march=native -Ofast -pipe -fno-plt -fno-common -fno-semantic-interposition -fipa-pta -falign-functions=32 -fdevirtualize-at-ltrans -fuse-linker-plugin -floop-nest-optimize -fgraphite-identity -fno-signed-zeros -fno-trapping-math -fassociative-math -freciprocal-math -fno-math-errno -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fcx-limited-range -fexcess-precision=fast -w -flto=auto -fdiagnostics-color=always -fvisibility=hidden -fPIC -std=gnu90 -MD -MT CMakeFiles/cgame.dir/src/cgame/cg_atmospheric.c.o -MF CMakeFiles/cgame.dir/src/cgame/cg_atmospheric.c.o.d -o CMakeFiles/cgame.dir/src/cgame/cg_atmospheric.c.o -c /var/tmp/portage/games-fps/etlegacy-9999/work/etlegacy-9999/src/cgame/cg_atmospheric.c
[121/322] /usr/bin/x86_64-pc-linux-gnu-gcc -DDEFAULT_BASEDIR=\"/usr/share/etlegacy\" -DFEATURE_ANTICHEAT -DFEATURE_DBMS -DFEATURE_EDV -DFEATURE_FREETYPE -DFEATURE_GETTEXT -DFEATURE_MULTIVIEW -DFEATURE_OPENAL -DFEATURE_OPENAL_DLOPEN -DFEATURE_PAKISOLATION -DFEATURE_PNG -DFEATURE_PRESTIGE -DFEATURE_RATING -DFEATURE_SSL -DHAVE_SDL -DUSE_ICON -DUSE_RENDERER_DLOPEN -DUSING_OPENSSL -I/var/tmp/portage/games-fps/etlegacy-9999/work/etlegacy-9999_build/include -isystem /usr/include/SDL2 -isystem /usr/include/freetype2 -isystem /usr/include/AL -isystem /usr/include/minizip  -march=native -Ofast -pipe -fno-plt -fno-common -fno-semantic-interposition -fipa-pta -falign-functions=32 -fdevirtualize-at-ltrans -fuse-linker-plugin -floop-nest-optimize -fgraphite-identity -fno-signed-zeros -fno-trapping-math -fassociative-math -freciprocal-math -fno-math-errno -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fcx-limited-range -fexcess-precision=fast -w -flto=auto -fdiagnostics-color=always -fvisibility=hidden -std=gnu99 -MD -MT CMakeFiles/etl.dir/src/sdl/sdl_input.c.o -MF CMakeFiles/etl.dir/src/sdl/sdl_input.c.o.d -o CMakeFiles/etl.dir/src/sdl/sdl_input.c.o -c /var/tmp/portage/games-fps/etlegacy-9999/work/etlegacy-9999/src/sdl/sdl_input.c
�[31mFAILED: �[0mCMakeFiles/etl.dir/src/sdl/sdl_input.c.o 
/usr/bin/x86_64-pc-linux-gnu-gcc -DDEFAULT_BASEDIR=\"/usr/share/etlegacy\" -DFEATURE_ANTICHEAT -DFEATURE_DBMS -DFEATURE_EDV -DFEATURE_FREETYPE -DFEATURE_GETTEXT -DFEATURE_MULTIVIEW -DFEATURE_OPENAL -DFEATURE_OPENAL_DLOPEN -DFEATURE_PAKISOLATION -DFEATURE_PNG -DFEATURE_PRESTIGE -DFEATURE_RATING -DFEATURE_SSL -DHAVE_SDL -DUSE_ICON -DUSE_RENDERER_DLOPEN -DUSING_OPENSSL -I/var/tmp/portage/games-fps/etlegacy-9999/work/etlegacy-9999_build/include -isystem /usr/include/SDL2 -isystem /usr/include/freetype2 -isystem /usr/include/AL -isystem /usr/include/minizip  -march=native -Ofast -pipe -fno-plt -fno-common -fno-semantic-interposition -fipa-pta -falign-functions=32 -fdevirtualize-at-ltrans -fuse-linker-plugin -floop-nest-optimize -fgraphite-identity -fno-signed-zeros -fno-trapping-math -fassociative-math -freciprocal-math -fno-math-errno -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fcx-limited-range -fexcess-precision=fast -w -flto=auto -fdiagnostics-color=always -fvisibility=hidden -std=gnu99 -MD -MT CMakeFiles/etl.dir/src/sdl/sdl_input.c.o -MF CMakeFiles/etl.dir/src/sdl/sdl_input.c.o.d -o CMakeFiles/etl.dir/src/sdl/sdl_input.c.o -c /var/tmp/portage/games-fps/etlegacy-9999/work/etlegacy-9999/src/sdl/sdl_input.c
�[01m�[K/var/tmp/portage/games-fps/etlegacy-9999/work/etlegacy-9999/src/sdl/sdl_input.c:�[m�[K In function '�[01m�[KIN_PrintKey�[m�[K':
�[01m�[K/var/tmp/portage/games-fps/etlegacy-9999/work/etlegacy-9999/src/sdl/sdl_input.c:202:27:�[m�[K �[01;31m�[Kerror: �[m�[K'�[01m�[KKMOD_RESERVED�[m�[K' undeclared (first use in this function)
  202 |         if (keysym->mod & �[01;31m�[KKMOD_RESERVED�[m�[K)
      |                           �[01;31m�[K^~~~~~~~~~~~~�[m�[K
�[01m�[K/var/tmp/portage/games-fps/etlegacy-9999/work/etlegacy-9999/src/sdl/sdl_input.c:202:27:�[m�[K �[01;36m�[Knote: �[m�[Keach undeclared identifier is reported only once for each function it appears in
[122/322]
@shoober420 shoober420 changed the title Build error ( Build error [Kerror: �[m�[K'�[01m�[KKMOD_RESERVED�[m�[K' undeclared (first use in this function) Aug 13, 2021
@rmarquis
Copy link
Contributor

Looks like it doesn't find SDL2 library. Is it installed on your system?

@shoober420
Copy link
Author

Yes, maybe I'm missing a certain symlink it looks for? Is it looking for SDL1 instead of SDL2?

@gentoo:~$ ln -s /usr/lib/libSDL2                                                                                                                                                              
 libSDL2-2.0.so.0        libSDL2_image-2.0.so.0.6.0  libSDL2_mixer-2.0.so.0      libSDL2_net-2.0.so.0      libSDL2.so            libSDL2_ttf-2.0.so.0.14.1                                     
 libSDL2-2.0.so.0.17.0   libSDL2_image.so            libSDL2_mixer-2.0.so.0.2.2  libSDL2_net-2.0.so.0.0.1  libSDL2_test.a        libSDL2_ttf.so            
 libSDL2_image-2.0.so.0  libSDL2main.a               libSDL2_mixer.so            libSDL2_net.so            libSDL2_ttf-2.0.so.0
@gentoo:~$ ln -s /usr/lib64/libSDL2                                                                                                                                                            
 libSDL2-2.0.so.0        libSDL2_image-2.0.so.0.6.0  libSDL2_mixer-2.0.so.0      libSDL2_net-2.0.so.0      libSDL2.so            libSDL2_ttf-2.0.so.0.14.1                                     
 libSDL2-2.0.so.0.17.0   libSDL2_image.so            libSDL2_mixer-2.0.so.0.2.2  libSDL2_net-2.0.so.0.0.1  libSDL2_test.a        libSDL2_ttf.so            
 libSDL2_image-2.0.so.0  libSDL2main.a               libSDL2_mixer.so            libSDL2_net.so            libSDL2_ttf-2.0.so.0

@shoober420
Copy link
Author

Im getting this same error in iortcw and ioquake3 as well.

@rmarquis
Copy link
Contributor

I see SDL 2.0.16 has been released just a few days ago. Your log seem to build with 2.0.17, which is the unstable version. Maybe something broke in that last version.

As a reminder, we don't support build made with distro packaging systems (we can't, but you might ask the packaging maintainer), but you might succeed in using the provided ./easybuild.sh script.

@shoober420
Copy link
Author

shoober420 commented Aug 13, 2021

If an internal command changed in a recent SDL2 git master commit, should I make an issue on the SDL2 git page?

@rmarquis
Copy link
Contributor

It depends on what broke.

In your case, as a first step I'd start to install SDL 2.0.16 (SDL project uses even number for the stable version, odd number for development version) and see if that works. If 2.0.16 works, then this could be a regression on their end. If not, maybe we'll have to adjust something in ETL code.

This said, I can't see anything relevant in the latest major changes.

@rmarquis rmarquis changed the title Build error [Kerror: �[m�[K'�[01m�[KKMOD_RESERVED�[m�[K' undeclared (first use in this function) Build error: 'KMOD_RESERVED' undeclared (first use in this function) Aug 13, 2021
@shoober420
Copy link
Author

shoober420 commented Aug 14, 2021

@rmarquis

@zturtleman found the sdl2 git commit that borked the build for etlegacy / iortcw / ioquake3 if it helps any.

ioquake/ioq3#518 (comment)

@rmarquis
Copy link
Contributor

Thank you! We'll need to keep this change in mind, when we move to the stable SDL v2.0.18 release.
This change appeared after 2.0.16 tag, so 2.0.16 is unaffected.

@rmarquis rmarquis added cat: client Category engine (client, renderer, sdl) P2: High Priority 2 📝 Task Indirectly related to code: libs update, documentation labels Aug 14, 2021
@rmarquis rmarquis changed the title Build error: 'KMOD_RESERVED' undeclared (first use in this function) SDL 2.0.18: Build error: 'KMOD_RESERVED' undeclared (first use in this function) Aug 14, 2021
@rmarquis rmarquis added this to the 2.78 milestone Aug 14, 2021
@zturtleman
Copy link
Contributor

KMOD_RESERVED was restored in SDL so this build issue no longer exists. I would recommend displaying KMOD_SCROLL in in_keyboardDebug 1 messages like done in this ioquake3 commit though.

@rmarquis rmarquis modified the milestones: 2.78, 2.79 Sep 28, 2021
@jackeri jackeri modified the milestones: 2.79, 2.80 Dec 23, 2021
@Aranud Aranud modified the milestones: 2.80, Future Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat: client Category engine (client, renderer, sdl) P2: High Priority 2 📝 Task Indirectly related to code: libs update, documentation
Projects
None yet
Development

No branches or pull requests

5 participants