I’ve made a script like so:
#! /bin/bash
/path/to/program
and made it executable. I want to be able to double click on it in Nautilus, choose “run in terminal” and everything should be the same as when I invoke the script myself from the terminal, where it works fine. When I double click though, I get the error message “error while loading shared libraries: libpylonbase-2.3.3.so: cannot open shared object file: No such file or directory” and the terminal closes immediately. libpylonbase-2.3.3 has to do with an industrial camera that is used within the program. Can anyone see the reason for it working it one of the cases and not in the other?
Check that the environment variables are the same when you run your program from the terminal and from Nautilus. You can do this by inserting the following line:
At least $PATH and $LD_LIBRARY_PATH should be the same.