Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Platform: Lubuntu 11.10 x64

Program: Gish

When I try to launch Gish from the command line (/opt/gish/gi.sh), there are no problems. But when I try to launch it from the LXDE menu, it will not start.

Contents of /usr/share/applications/gish.desktop:

[Desktop Entry]
Categories=Game;ActionGame;AdventureGame;ArcadeGame;
Exec=/opt/gish/gi.sh
Path=/opt/gish
Icon=x-gish
Terminal=false
Type=Application
Name=Gish

I tried changing Terminal=false to Terminal=true to debug it, but then I just got a blank terminal, and the game didn't start.

Edit:

Here is some additional information, as requested by Eliah Kagan below:

  • I tried editing /usr/share/applications/gish.desktop, as recommended, but it had no effect
  • However, ~/.xsession-errors contained the following error:

    [: 8: x86_64: unexpected operator
    ./gish_32: error while loading shared libraries: libGL.so.1: wrong ELF class: ELFCLASS64
    

    I think there's a problem with the /opt/gish/gi.sh shell script. This is its contents:

    cd /opt/gish/
    
    MACHINE_TYPE=`uname -m`
    if [ ${MACHINE_TYPE} == 'x86_64' ]; then
      ./gish_64
    else
      ./gish_32
    fi
    

    I'm not too familiar with Bash, so hopefully someone else can point out the error.

    I have a 64-bit machine. I think that when the script is run from the command line, it's properly launching the 64-bit version (/opt/gish/gish_64), but when it's run from the LXDE menu, it's launching the 32-bit version (/opt/gish/gish_32), which is causing the libGL.so.1 error. However, this may be related to my libGL.so.1 problems with 2 other games.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

General advice for this sort of problem

Try changing Exec=/opt/gish/gi.sh to Exec=sh /opt/gish/gi.sh.

If that doesn't work, try changing the Path line so it specifies whatever directory you're in when you run the program in the Terminal. Assuming you're in your home directory, the line would become Path=/home/aberration where aberration is replaced by your username on your Ubuntu system (if different).

If that doesn't work either, then please open the file called .xsession-errors located in your home directory (in PCManFM you'll have to press Ctrl+H or click View > Show Hidden to make this and other files that start with . appear), select its entire contents, copy it to the clipboard, paste it at the Ubuntu Pastebin, and edit your question to include the URL for it. Make sure that you have attempted to run the game from the LXDE menus very shortly before opening .xsession-errors so that messages pertaining to the failure are likely to appear near the end of the file.

Advice specific to the error in .xsession_errors and the script's specific contents

It seems likely that your suspicion is correct; that is, that when the script is run from LXPanel, the test for whether or not your architecture is 64-bit is not working properly. I am not sure exactly what is going wrong. But since the script does not have a leading hashbang line (i.e., a line starting with #! followed immediately by the full path to the program that is to act as the script's interpreter), it is probably being run by a different shell when you run it from LXPanel than when you run it from bash in LXTerminal. When you run it from LXPanel, it is probably being run by the default shell (/bin/sh, which is a symbolic link to the dash shell), whereas when you run it from within bash in LXTerminal, it is being run by bash. The script uses some unusual syntax that I am not familiar with, which might reflect that my scripting knowledge is a bit rusty, but might be because I write scripts for sh/dash rather than bash.

I recommend that you back up the script (sudo cp /opt/gish/gi.sh /opt/gish/gi.sh.old) and then try editing it by adding the line #!/bin/bash to the very top, to make it run with bash. Then see if it runs properly.

If it does, then I recommend submitting a bug report to the creators of gi.sh. (I am guessing this is not an Ubuntu package, since it is installed in /opt, so you'll have to check if the project has its own bug reporting guidelines first.) While the fix detailed above is appropriate for Ubuntu, a fix likely to work properly on a wider variety of Unix-like systems (Linux-based and otherwise) would be to use #!/usr/bin/env bash rather than #!/bin/bash since env is in /usr/bin significantly more often than bash is in /bin. (The authors should also be aware that bash is not present on all Unix-like systems, so if Gish is intended to run on systems that are likely not to have bash and it doesn't otherwise require bash, they might want to edit the script.) And either way, a script that requires bash should not be suffixed .sh, but should instead be suffixed .bash (or not at all).

If that change does not make the script run properly, then it's still worth checking to see if the problem was that the 32-bit version of Gish was running instead of the 64-bit version. So you can make a new .desktop file with the contents:

[Desktop Entry]
Categories=Game;ActionGame;AdventureGame;ArcadeGame;
Exec=/opt/gish/gish_64
Path=/opt/gish
Icon=x-gish
Terminal=false
Type=Application
Name=Gish

Running from that .desktop file--assuming it works--should confirm that the problem is that the wrong executable is being run (and should also work around the problem for you, so you can run Gish from LXPanel).

share|improve this answer
    
Please take a look at the edit I made above. I may have made some headway on the source of the error, but I'm not sure how to fix it. –  srunni Nov 20 '11 at 17:28
    
@aberration I've edited my answer to provide advice specific to the information you've just provided. –  Eliah Kagan Nov 21 '11 at 1:45
    
That was it, it seems to be working just fine now! –  srunni Nov 21 '11 at 2:38
    
@aberration If you submit a bug report and it's public (most bug reports are but I don't know what kind of bug tracking system Gish uses), please post a link to it here--then other users with the same problem will find it when they search and find this page. –  Eliah Kagan Nov 21 '11 at 3:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.