Error compiling on Arch Linux: "SDL_version.h: No such file or directory

Hello, I’m having trouble compiling ioquake3 on Arch Linux. Here is a link to a paste with my compile log:

Not sure why I’m getting this error since I do seem to have the necessary packages installed:

% pacman -Q | grep sdl
lib32-sdl12-compat 1.2.64-1
lib32-sdl2 2.26.5-1
sdl12-compat 1.2.64-1
sdl2 2.26.5-2
sdl2_image 2.6.3-1

And the file is even present in /usr/include/SDL2/. What am I missing?

Hmm, I’m not super familiar with arch. Are you compiling from a checkout you made of our git repository on your own, or from some kind of arch provided build system for ioquake3?

Maybe a silly question, is pkg-config installed?

Yup, it’s installed. And I’m compiling from the git repository, although I’m also facing the issue when I try to build using the AUR.

From your log, the SDL2 flags are missing from CFLAGS and CLIENT_LIBS. Though it doesn’t make sense why they’re missing. It works for me in an ArchLinux VM.

What is the output of pkg-config --cflags sdl2 ?

1 Like
% pkg-config --cflags sdl2
-I/usr/include/SDL2 -D_REENTRANT


Hmm, very strange. You could try skipping getting SDL2 flags from system using this:

make SDL_CFLAGS="-I/usr/include/SDL2 -D_REENTRANT" SDL_LIBS="-lSDL2"
1 Like

I was able to compile it with this, thank you very much!
So make is supposed to get those flags from pkg-config? :thinking:

Yeah. It tries pkg-config if it’s found by which pkg-config. If SDL_CFLAGS is empty (pkg-config not found or failed) it falls back to sdl2-config if it’s found by which sdl2-config.

My best guess is checking if pkg-config/sdl2-config commands exist are both failing. You could try removing “2> /dev/null” from this line in Makefile (and then run make) to show if they’re not found.

1 Like

Thanks a lot for your help, your guess was right, the checking commands were failing… because I somehow didn’t have which installed. It was working for me with ZSH because it’s apparently a built-in command there, but since the makefile uses sh, that didn’t work…
Thank you very much for helping me figuring it out!

1 Like