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

Game does not compile on Linux out of the box for several reasons #4

Open
Arcanister opened this issue Aug 11, 2019 · 6 comments
Open

Comments

@Arcanister
Copy link

First of all, you hardcode "g++-5" in game/sdl/linux/makefile
To continue compilation I had to remove -5 from several places on top of the make file so that executable is just "g++".

Then build has stopped because of missing #include <stdio.h> in several files:
game/httppackinfomanager.cpp with error: 'fopen' was not declared in this scope
game/httppackmanager.cpp:54:51: error: 'fopen' was not declared in this scope
mpshared/packinfomanager.cpp:43:54: error: 'fopen' was not declared in this scope
mpshared/indexloader.cpp:12:38: error: 'fopen' was not declared in this scope

Next problem was:

../../gameform.cpp:4:30: fatal error: game/Multiplayer.h: No such file or directory
compilation terminated.
../../Multiplayer.cpp:2:30: fatal error: game/Multiplayer.h: No such file or directory
compilation terminated.
In fact this file does not exist, however file game/multiplayer.h does. So changing this two files to multiplayer.h did work.

After those five files the game compile successfully.

Another problem is with file game/sdl/linux/install.sh
It uses if ! dpkg -l | grep libsdl2-dev > /dev/null ; then
This line which would only work in distributions based on deb packages, such as Debian and Ubuntu but not in other distributions. I think it's better to say that SDL2 is required for building and recommend to install this two packages: libsdl2-dev libcurl4-openssl-dev in your readme file

(though in my distribution -dev packages are not separated from main packages)

@Arcanister
Copy link
Author

The game still does not start though, after I have copied ./HostileTakeover executable to ~/Games/HostileTakeover/ along with two files which were copied by script install.sh with this error message:

Incorrect game graphics version or no game graphics installed
I start it with ./HostileTakeover from the game directory. This message produced by game/game.cpp in this place:

        ddword ddwSizes8bpp = IsDataPresent(8);
        ddword ddwSizes4bpp = IsDataPresent(4);
        if (ddwSizes8bpp == 0 && ddwSizes4bpp == 0) {
                HostMessageBox(TEXT("Incorrect game graphics version or no game graphics installed"));
                return false;
        }

Apparently it can't find this file: htdata832.pdb. I thought that it's because of makefile having hardcoded path: -rpath ~/Games/HostileTakeover -lcurl -lpthread but I'm not sure. I didn't get REL=1 build to start but debug build shows a window.

@Arcanister
Copy link
Author

Files game/sdl/sdlpackfile.cpp and mpshared/packinfomanager.cpp have lines "return false;" which cause type mismatch:

error: cannot convert ‘bool’ to ‘json::JsonMap*’ in return```

@sathisse
Copy link

To get past "Incorrect game graphics version or no game graphics installed" for the release build, the database version check must be more permissive. That can be done by sending in true for fUpwardCompatOK for the last call to Game::CheckDatabaseVersion(). So change line 1438 in game.cpp from:
if (CheckDatabaseVersion(pszMainDataDir, szPdb, false))
to:
if (CheckDatabaseVersion(pszMainDataDir, szPdb, true))

@Arcanister
Copy link
Author

sathisse, thanks. Your suggestion worked, now release build works for me.
But are there active developers who can add some fixes to the main tree?

@N104
Copy link
Member

N104 commented Aug 19, 2019

It's been a while since I've had the time to work on this project. I didn't work much with the Linux port and makefile beyond getting it to build/run on my machine. Feel free to send pull requests.

@Mistik
Copy link

Mistik commented Mar 26, 2024

It's been a while since I've had the time to work on this project. I didn't work much with the Linux port and makefile beyond getting it to build/run on my machine. Feel free to send pull requests.

what about the web version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants