[Resolved] Help Needed: X4 Non-Steam Executable Fails with Missing Library Error (Linux Mint)

This forum is the ideal place for all discussion relating to X4. You will also find additional information from developers here.

Moderator: Moderators for English X Forum

Dunkh4n
Posts: 6
Joined: Wed, 13. Sep 17, 16:36
x3ap

[Resolved] Help Needed: X4 Non-Steam Executable Fails with Missing Library Error (Linux Mint)

Post by Dunkh4n »

Hi everyone,

I know this forum isn’t specifically focused on Linux-related issues, but if anyone here plays X4 on Linux and could help me, I’d greatly appreciate it!

I’m encountering an issue while trying to set up and launch X4: Foundations (Non-Steam version) on my Linux system. Here’s the situation:

Setup: I’m running X4: Foundations (Non-Steam) on Linux Mint. The game executable (X4_nonsteam) is located in the following directory:

Code: Select all

/home/XXXXX/.steam/debian-installation/steamapps/common/X4 Foundations/
What Happens:

If I navigate to the folder and double-click the X4_nonsteam file, the game launches perfectly.
However, when I try to execute the command directly in the terminal:

Code: Select all

/home/XXXXX/.steam/debian-installation/steamapps/common/X4\ Foundations/X4_nonsteam
I get the following error:

Code: Select all

    /home/XXXXX/.steam/debian-installation/steamapps/common/X4 Foundations/X4_nonsteam: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: No such file or directory
Additional Notes:

I’ve verified that the library libluajit-5.1.so.2 is not currently installed on my system.
I’ve also tried setting up a .desktop shortcut in ~/.local/share/applications with the following configuration:

Code: Select all

    [Desktop Entry]
    Name=X4 No Steam
    Comment=Play this game without Steam
    Exec=/home/XXXXX/.steam/debian-installation/steamapps/common/X4\ Foundations/X4_nonsteam
    Icon=steam_icon_392160
    Terminal=false
    Type=Application
    Categories=Game;
    Name[en_US]=X4 No Steam
When I try launching the game via the shortcut, it doesn’t work either, presumably for the same reason.

What I’ve Tried:

Installing the missing library (libluajit-5.1) via my package manager:

sudo apt install libluajit-5.1-2

However, the problem persists.

Has anyone encountered this library-related issue when running the Non-Steam version of X4 on Linux? Any advice on how to resolve the missing library issue and properly configure the game or desktop shortcut would be greatly appreciated.

Thanks in advance!
Last edited by Dunkh4n on Mon, 2. Dec 24, 11:49, edited 1 time in total.
nlseven
Posts: 4
Joined: Mon, 6. Sep 21, 05:43
x4

Re: Help Needed: X4 Non-Steam Executable Fails with Missing Library Error (Linux Mint)

Post by nlseven »

Hey mate,

What if you cd to the game directory and then try launching ./X4_nonsteam?
The game folder also contains a `libs` folder that has a lot of those files.

Your desktop entry should also contain a Path= section pointing to your installation folder, e.g.

Code: Select all

    [Desktop Entry]
    Name=X4 No Steam
    Comment=Play this game without Steam
    Exec="/home/XXXXX/.steam/debian-installation/steamapps/common/X4 Foundations/X4_nonsteam"
    Path="/home/XXXXX/.steam/debian-installation/steamapps/common/X4 Foundations"
    Icon=steam_icon_392160
    Terminal=false
    Type=Application
    Categories=Game;
    Name[en_US]=X4 No Steam
See if that works for you?
User avatar
PGeyer-Ego
EGOSOFT
EGOSOFT
Posts: 56
Joined: Thu, 9. Jun 22, 14:37
x4

Re: Help Needed: X4 Non-Steam Executable Fails with Missing Library Error (Linux Mint)

Post by PGeyer-Ego »

Hi Dunkh4n

As nlseven stated, this seems to be a path issue - it's looking for local libraries, relative to wherever you run the game from - with your Desktop entries, and how you tried running it from the terminal, that location is probably your home directory '/home/XXXXX/' and thus would be looking for '/home/XXXXX/libs' which obviously doesn't exist. The solution by nlseven should work, but if it doesn't please let me know and I'll figure out what it is.
Dunkh4n
Posts: 6
Joined: Wed, 13. Sep 17, 16:36
x3ap

Re: Help Needed: X4 Non-Steam Executable Fails with Missing Library Error (Linux Mint)

Post by Dunkh4n »

nlseven wrote: Mon, 2. Dec 24, 01:35 Hey mate,

What if you cd to the game directory and then try launching ./X4_nonsteam?
The game folder also contains a `libs` folder that has a lot of those files.

Your desktop entry should also contain a Path= section pointing to your installation folder, e.g.

Code: Select all

    [Desktop Entry]
    Name=X4 No Steam
    Comment=Play this game without Steam
    Exec="/home/XXXXX/.steam/debian-installation/steamapps/common/X4 Foundations/X4_nonsteam"
    Path="/home/XXXXX/.steam/debian-installation/steamapps/common/X4 Foundations"
    Icon=steam_icon_392160
    Terminal=false
    Type=Application
    Categories=Game;
    Name[en_US]=X4 No Steam
See if that works for you?
That's working :) :)
Thanks a lot :)

Code: Select all

[Desktop Entry]
Name=X4 No Steam
Comment=Play this game not on Steam
Exec=env LD_LIBRARY_PATH="/home/XXXXX/.steam/debian-installation/steamapps/common/X4 Foundations/lib" "/home/dunkhan/.steam/debian-installation/steamapps/common/X4 Foundations/X4_nonsteam"
Path=/home/XXXXX/.steam/debian-installation/steamapps/common/X4 Foundations
Terminal=false
Type=Application
Categories=Game;
jlehtone
Posts: 22566
Joined: Sat, 23. Apr 05, 21:42
x4

Re: Help Needed: X4 Non-Steam Executable Fails with Missing Library Error (Linux Mint)

Post by jlehtone »

PGeyer-Ego wrote: Mon, 2. Dec 24, 10:25 Hi Dunkh4n

As nlseven stated, this seems to be a path issue - it's looking for local libraries, relative to wherever you run the game from - with your Desktop entries, and how you tried running it from the terminal, that location is probably your home directory '/home/XXXXX/' and thus would be looking for '/home/XXXXX/libs' which obviously doesn't exist. The solution by nlseven should work, but if it doesn't please let me know and I'll figure out what it is.
That sounds like the binary has been built with RPATH, but without $ORIGIN. (Plain 'lib' is relative, while $ORIGIN/lib is kind of absolute.
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.

Return to “X4: Foundations”