Hedgewars 0.9.16 for Slackware

No replies
User offline. Last seen 3 years 30 weeks ago. Offline
Joined: 2011-08-09
Posts: 17

I have tried to compile Hedgewars 0.9.16 under Slackware Linux 13.37. There were some problems which also were successfully solved. I'm about to share the instructions I used; additions and editions are welcomed.

Speaking briefly, the problems are the following. An error:

/usr/bin/ld: cannot find -llua.a

Two warnings:
hwengine.pas(164,68) Warning: range check error while evaluating constants
Linking ../bin/hwengine
/usr/bin/ld: warning: ../bin/link.res contains output sections; did you forget -T?

The problem with liblua.a was already discussed:
Nevertheless, I will give a complete instruction and show once again how to overcome it. The warning from ld is usual and not critical. The warning with "hwengine.pas" seems not critical, but needs investigation.

I suppose the reader knows how to use a terminal emulator and how to run console commands. Also I think that the reader understands what the instructions below do and can easily modify them if necessary (for example, if he decides to use the latest versions of Free Pascal and Lua, or if he doesn't know the password of his superuser).

1. To install dependencies, download Free Pascal and compile Lua. Since Free Pascal is written in Free Pascal language, binaries are required, which can be officially taken from
Everything is very easy here, just unpack the archive and run the script "install.sh", answer a few questions by just pressing "Enter" key, for example.

In my case Free Pascal was installed into $HOME/fpc-2.4.4. If you have given another destination directory for Free Pascal, use it instead of $HOME/fpc-2.4.4. Pay attention that you need to run "install.sh" as a superuser if you want later to make install Hedgewars under root.

2. Lua source code can be downloaded officially from the following link:
Unpack it elsewhere, go into the subdirectory "src" and put there the following official patch:
As they write, the patch should fix some errors after you apply it:

$patch < patch-lua-5.1.4-3

Then you can return to the parent directory with Lua sources and compile Lua by running:
$make linux

Check the building:
$make test

If you see the message:
src/lua test/hello.lua
Hello world, from Lua 5.1!

then you can think that Lua works, install it by running the standard command as a superuser:
#make install

3. Download your favourite game:
Unpack the file, think of the directory where you want to install Hedgewars ($HOME/hedgewars in my case) and configure it (telling CMake where to find Free Pascal compiler):


Warning: you must have write access to the directories where you install Hedgewars. If you did not install Free Pascal under root, you will not be able to compile or install Hedgewars as a superuser.

4. And now before compiling Hedgewars open "hedgewars/config.inc", find there the line "cLuaLibrary = 'liblua.a'" and replace it by "cLuaLibrary = 'liblua'" (i.e. remove the ".a"). If you try to do it after already running compilation you will not be able to compile it once again since pas-files are modified during compilation; in this case you will need to delete the source code and unpack the source archive again.

5. Go back to the parent directory with Hedgewars sources. Run compilation (together with installation, switch to superuser if necessary):

$make install

I have got here two warnings:
hwengine.pas(164,68) Warning: range check error while evaluating constants
Linking ../bin/hwengine
/usr/bin/ld: warning: ../bin/link.res contains output sections; did you forget -T?

They write that the warning from ld "is linked with the following: FPC generates a script for installer using an obsolete format. binutils are updated, FPC is not"
So, this seems to be useful and not critical.

The second warning blames the following line from the unit "hwengine", more exactly the symbol after ")":

while SDL_PeepEvents(@event, 1, SDL_GETEVENT, SDL_ALLEVENTS) > 0 do

I have no ideas how to comment it, hoping the warning is under the control of the developers.

6. To run the game, type:


replacing "~/hedgewars" with the directory where you have installed the game. Enjoy!

Copyright © 2004-2017 Hedgewars Project. All rights reserved. [ contact ]