jiayouxjh / grafx2

Automatically exported from code.google.com/p/grafx2
0 stars 0 forks source link

Donesn't find data directory (gui skin) when run from shortcut #326

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
On Ubuntu, in the following cases:
* use the grafx2 shortcut in Ubuntu's menu 
* type 'grafx2' in the terminal/run application
the application doesn't start. 
Error message is:

Error number 0 occured in file loadsave.c, line 669, function Load_image.
Error number 0 occured in file loadsave.c, line 669, function Load_image.
Unable to load the skin image (missing? not an image file?)
Error number 1 occured in file main.c, line 665, function Init_program.
Error: File containing the GUI graphics is missing!
This program cannot run without this file.

Running the executable from a shell does work.

This is since the directory re-structuring  (r1375) : after "make install",
there is no longer a shell script, it always runs the executable directly. 

My hypothesis is that argv[0] doesn't provide the executable path in this
case... I now remember that one argument in favor of the script was to help
get executable path.
One possible fix is to use "readlink /proc/self/exe" technique, as
described here:
http://stackoverflow.com/questions/1023306/finding-current-executables-path-with
out-proc-self-exe#1024937
The difficulty is in making this change on platforms that need it, and not
on platforms where this method doesn't work.

Reported by RaveyGB.

Original issue reported on code.google.com by yrizoud on 10 Mar 2010 at 2:40

GoogleCodeExporter commented 9 years ago
Implemented in r1380.
Seems to work fine on Debian. The change affects only platforms where __linux__ 
is
defined, except OSX.

Original comment by yrizoud on 11 Mar 2010 at 8:45

GoogleCodeExporter commented 9 years ago

Original comment by pulkoma...@gmail.com on 9 Aug 2010 at 9:46

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by pulkoma...@gmail.com on 22 Aug 2010 at 1:39

GoogleCodeExporter commented 9 years ago
Ok, this just works now.

Original comment by pulkoma...@gmail.com on 22 Aug 2010 at 7:06