Linux Build -- fatal error: 'SDL_version.h' file not found

Compiling in ubuntu with sdl2 library installed (usr/include/SDL2):

ubuntu@ubuntu:~/Github/ioq3$ make
make[1]: Entering directory ‘/home/ubuntu/Github/ioq3’

Building in build/release-linux-x86_64:
PLATFORM: linux
ARCH: x86_64
VERSION: 1.36_GIT_2b42f0bd-2020-07-15
COMPILE_PLATFORM: linux
COMPILE_ARCH: x86_64
HAVE_VM_COMPILED: true
PKG_CONFIG: pkg-config
CC: cc

CFLAGS:
-Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes -pipe -DUSE_ICON
-DARCH_STRING=“x86_64” -DNO_GZIP -Icode/zlib -DUSE_INTERNAL_JPEG -Icode/jpeg-8c
-DUSE_LOCAL_HEADERS -DPRODUCT_VERSION=“1.36_GIT_2b42f0bd-2020-07-15” -Wformat=2
-Wno-format-zero-length -Wformat-security -Wno-format-nonliteral -Wstrict-aliasing=2
-Wmissing-format-attribute -Wdisabled-optimization -Werror-implicit-function-declaration
-MMD -DNDEBUG -O3 -ffast-math

CLIENT_CFLAGS:
-D_REENTRANT -I/usr/include/SDL2 -DUSE_OPENAL -DUSE_OPENAL_DLOPEN -DUSE_CURL
-DUSE_CURL_DLOPEN -DUSE_VOIP -DUSE_CODEC_OPUS -DOPUS_BUILD -DHAVE_LRINTF -DFLOATING_POINT
-DFLOAT_APPROX -DUSE_ALLOCA -Icode/opus-1.2.1/include -Icode/opus-1.2.1/celt
-Icode/opus-1.2.1/silk -Icode/opus-1.2.1/silk/float -Icode/opusfile-0.9/include
-DUSE_CODEC_VORBIS -Icode/libvorbis-1.3.6/include -Icode/libvorbis-1.3.6/lib
-Icode/libogg-1.3.3/include -DUSE_RENDERER_DLOPEN -DUSE_MUMBLE

SERVER_CFLAGS:
-DUSE_VOIP

LDFLAGS:

LIBS:
-ldl -lm

CLIENT_LIBS:
-Wl,-rpath,/usr/lib -Wl,–enable-new-dtags -lSDL2 -lrt

AUTOUPDATER_LIBS:
-ldl

Output:
ioq3ded.x86_64
ioquake3.x86_64
renderer_opengl1_x86_64.so
renderer_opengl2_x86_64.so
baseq3/cgamex86_64.so
baseq3/qagamex86_64.so
baseq3/uix86_64.so
missionpack/cgamex86_64.so
missionpack/qagamex86_64.so
missionpack/uix86_64.so
baseq3/vm/cgame.qvm
baseq3/vm/qagame.qvm
baseq3/vm/ui.qvm
missionpack/vm/cgame.qvm
missionpack/vm/qagame.qvm
missionpack/vm/ui.qvm

make[2]: Entering directory ‘/home/ubuntu/Github/ioq3’
make[2]: ‘build/release-linux-x86_64/ioq3ded.x86_64’ is up to date.
CC code/client/cl_main.c
In file included from code/client/cl_main.c:27:
code/client/…/sys/sys_local.h:28:11: fatal error: ‘SDL_version.h’ file not found

include “SDL_version.h”

            ^~~~~~~~~~~~~~~

1 error generated.
Makefile:2662: recipe for target ‘build/release-linux-x86_64/client/cl_main.o’ failed
make[2]: *** [build/release-linux-x86_64/client/cl_main.o] Error 1
make[2]: Leaving directory ‘/home/ubuntu/Github/ioq3’
Makefile:1365: recipe for target ‘targets’ failed
make[1]: *** [targets] Error 2
make[1]: Leaving directory ‘/home/ubuntu/Github/ioq3’
Makefile:1316: recipe for target ‘release’ failed
make: *** [release] Error 2

My sdl2 library:

ubuntu@ubuntu:~/Github/ioq3$ pkg-config --cflags --libs sdl2
-D_REENTRANT -I/usr/include/SDL2 -Wl,-rpath,/usr/lib -Wl,–enable-new-dtags -lSDL2

It seems to me that the header should instead be included with: include “SDL2/SDL_version.h”.
Am I missing something here and doing something wrong?

Okay I found the issue. I was somehow missing files in /usr/include/SDL2. I did

sudo apt-get install libsdl2-dev

and it now compiles.

1 Like