Return to Castle Wolfenstein on GNU/Linux

Homer's picture

Like most iD titles, RTCW was ultimately released under the GPL, and is thus available as a GNU/Linux native game. Installing it under Gentoo is as simple as "emerge games-fps/rtcw", but unfortunately the game itself no longer works in modern GNU/Linux systems. This is only to be expected with proprietary software that becomes abandoned, and would affect the operation of that software on any OS, but naturally it doesn't have to be that way with Free Software, which can be revived at any time, even years later.

Currently there are several issues with iD Software's (now old) binary release, including a "ui/menddef.h not found" error, an inability to launch without a pre-existing "default.cfg" (and an inability to create an initial copy), a problem setting the correct video mode, an inability to accept keyboard input, broken support for SDL audio (which falls back to the now typically non-existant /dev/dsp device), a stack overflow condition triggered by large OpenGL extension strings (fixed by setting the variable "__GL_ExtensionStringVersion" to a lower number, typically 17700), and finally the source is not yet 64-bit ready.

The latest development of RTCW is bzzwolfsp [ed: the project is now called rtcwcoop], a "modification of the RTCW single player source code that brings you Cooperative gameplay", however I've had no luck getting it to work (the same "ui/menddef.h not found" error, and a "black screen of death" on the menu). It also seems to be only a coop game that offers no single player mode [ed: confirmed], and simply ignores the original pak3 files. Needless to say it's still a WIP.

Edit: 18th May 2013. You can safely ignore everything below (except the config information), and just fetch the fully patched and 64-bit-ready sources from here instead. This also fixes the cinematic cut-scene problem.

But then I discovered this thread on the Arch Linux forum.

Following the simple instructions on that forum, I was able to build a fully-functional version of RTCW, and play the original single-player mode.

Get the sources here (see post #7 in the above thread for a list of build dependencies):

hg clone # hg = Mercurial
cd rtcw-sp
cd src
mkdir sdl && cd sdl
patch -p0 <sdl_snd.c.patch
cd ../..
patch -p1 <rtcw-1.41.patch

git clone
cd RTCW-SP-linux/src
CFLAGS="-march=i686 -O2 -pipe -fomit-frame-pointer" # edit to taste, supports 64bit too
sed -i "s/\$BASE_CFLAGS = \$COMMON_CFLAGS . '-D.*$/\$BASE_CFLAGS = \$COMMON_CFLAGS . '-DNDEBUG $CFLAGS ';/" unix/Construct
mkdir -p ~/RTCW/main/

strip --strip-unneeded unix/release-x86-Linux/full/unix/wolfsp.exe unix/release-x86-Linux/out/main/*
cp unix/release-x86-Linux/full/unix/wolfsp.exe ~/RTCW/wolfsp
cp unix/release-x86-Linux/out/main/* ~/RTCW/main/
cd ~/RTCW

You'll need to copy all your *.pak3 files over to the ./main directory (e.g. from the demo files or Wine install from CD) then run:


This will create and populate the ~/.wolf directory with configuration files, then start the game in the default (low, 4:3) resolution. For those with an HD display, you'll need to exit the game then do the following:

echo "seta r_mode \"-1\"" >>~/.wolf/main/wolfconfig.cfg
sed -i 's/seta r_customwidth.*$/seta r_customwidth "1920"/' ~/.wolf/main/wolfconfig.cfg
sed -i 's/seta r_customheight.*$/seta r_customheight "1080"/' ~/.wolf/main/wolfconfig.cfg

Getting cheats to work is a bit convoluted, but it works if you do the following:

echo "set sv_cheats 1" >> ~/.wolf/main/user.cfg
./wolfsp.x86 +set sv_cheats 1

Start a new game, open the in-game console with the "`" (backtick) key, and type:

/sv_cheats 1

You'll get an error about sv_cheat being read-only. Ignore that, save the game, then quit. Launch RTCW again using the same flags as before, load the saved game, open the in-game console then type:

/give all



Anony Mouse's picture

fatal error: SDL/SDL.h: No such file or directory

hey man.

when I tried to do a make the log gives me the following


hostname ~/Downloads/rtcw/RTCW-SP-linux/src $ make
cd unix && ./cons
Wolfenstein version 1.41
cpu : x86
OS : Linux
configured for release build
CFLAGS: -pipe -fsigned-char -DNDEBUG -march=x86-64 -O2 -pipe -fomit-frame-pointer
gcc -pipe -fsigned-char -DNDEBUG -march=x86-64 -O2 -pipe -fomit-frame-pointer -c release-x86-Linux/full/unix/sdl_glimp.c -o release-x86-Linux/full/unix/sdl_glimp.o
release-x86-Linux/full/unix/sdl_glimp.c:52:21: fatal error: SDL/SDL.h: No such file or directory
compilation terminated.
cons: *** [release-x86-Linux/full/unix/sdl_glimp.o] Error 1
cons: errors constructing release-x86-Linux/full/unix/sdl_glimp.o
make: *** [all] Error 2


I've installed SDL and all dependencies. What could be wrong?

many thanks

Homer's picture

Development headers

You need more than just SDL, you also need its development headers, typically called "sdl-devel" or similar, depending on your distro. This is because you are not merely using SDL but actually compiling software that links to it. This is called a "build dependency".

Anony Mouse's picture

Console not showing


thanks to your instructions, I was able to replay one of my favourites shooters of all time on my Linux machine. I finished RTCW on the hardest level. Now I'd like to play some custom maps that can be found on the web, but this requires me to access to the console. There's no way I can access that one. I try the key below ESC, but to no avail. It's a german keyboard and the game itself is in Italian. A sidenote: When I try to bind some German key (like 'Ä') to some action, I get . If I press some of these keys during gameplay, I get ' is not set, use controls menu to set'.

Do you have any idea why the console is not showing? Is there a way to configure the console access from within a config file?


Homer's picture


First make sure that you have the following in your ~/.wolf/main/wolfconfig.cfg

bind ` "toggleconsole"


bind ~ "toggleconsole"

Also make sure that your $LANG environment is set correctly, and that you can normally type the above characters (or whatever other characters you choose) in a terminal. If you have no way to type those characters in other programs, then they won't work in this game either, so you'll have to choose whatever characters your keyboard locale provides instead.

Anony Mouse's picture

toggleconsole were both set

toggleconsole were both set like you described in wolfconfig.cfg.

Also, I'm able to use the characters I've mentioned in other programs. I bought RTCW in Italian, but I'm running Ubuntu with German locale. However, I am now able to activate the console by using another binding (L in my case).

Anony Mouse's picture


It worked for me as well. I had to install one additional packet, and replace "i686" for "x86-64" in the recipe, and then I was able to compile the executable and play RtCW in my Ubuntu 12.04 LTS for x86-64.
Everything was O.K., thanks a lot! Greetings from Argentina.
Ricardo Caljem

Anony Mouse's picture

error in compilation

After lot of apt-get installing libs, I get this error and now I don't know how to proceed:

/usr/bin/ld: /usr/lib64/libSDL.a(SDL_syssem.o): undefined reference to symbol 'sem_getvalue@@GLIBC_2.2.5'
/lib/x86_64-linux-gnu/ error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
cons: *** [release-x86-Linux/full/unix/wolfsp.exe] Error 1
cons: errors constructing release-x86-Linux/full/unix/wolfsp.exe

Any idea? Thanks :-)

Anony Mouse's picture


Thank you for this -- I was ready to resort to WINE.

Worked perfectly on Fedora 18 (x86_64). Needed to install several libraries during the "./cons -- release" step, but elsewise went without a hitch -- and with the side effect (thanks to the SDL patch) of SOUND working (which is awesome).

Good article.

Anony Mouse's picture

Worked perfectly?

$ ./cons -- release
Wolfenstein version 1.41
cpu : x86
OS : Linux
configured for release build
CFLAGS: -pipe -fsigned-char -DNDEBUG -O3 -ffast-math -fno-strict-aliasing -fstrength-reduce
gcc -pipe -fsigned-char -DNDEBUG -O3 -ffast-math -fno-strict-aliasing -fstrength-reduce -c release-x86-Linux/full/jpeg-6/jerror.c -o release-x86-Linux/full/jpeg-6/jerror.o
In file included from release-x86-Linux/full/jpeg-6/../renderer/tr_local.h:37:0,
from release-x86-Linux/full/jpeg-6/jerror.c:22:
release-x86-Linux/full/jpeg-6/../renderer/qgl.h:57:19: fatal error: GL/gl.h: No such file or directory
compilation terminated.
cons: *** [release-x86-Linux/full/jpeg-6/jerror.o] Error 1
cons: errors constructing release-x86-Linux/full/jpeg-6/jerror.o

Homer's picture

Missing build dependencies

Sorry for my late reply. You've probably already figured this out for yourself, but just in case you haven't:

The error "fatal error: GL/gl.h: No such file or directory" tells you the development header file "gl.h" is missing. This is a component of the OpenGL project called MESA, typically called "mesa-dev" or "mesa-devel", depending on your distro.

On Debian and all its derivatives (such as Ubuntu and Mint) I believe the package containing "gl.h" is called "mesa-common-dev". On Gentoo it's simply part of the main "media-libs/mesa" package. On Fedora and other Red Hat derivatives it's called "mesa-libGL-devel".

Hope that helps.

Anony Mouse's picture

thanks for this

After a fk.... lot of lib upgrades working great on Mint 15 Cinnamon


am a nubie on Linux and everyday like it more.

Thx again