LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   command line execution vs clicking on the icon (http://www.linuxquestions.org/questions/linux-newbie-8/command-line-execution-vs-clicking-on-the-icon-720175/)

icecubeflower 04-19-2009 05:59 AM

command line execution vs clicking on the icon
 
I have a project I built with KDevelop. It has a Data folder with all the images and stuff. It's in the same directory as the executable. Does anyone know why if I start it from the command line ./project5 everything works but if I click on the gear icon in KDE it starts but all the images fail to load?

Zmyrgel 04-19-2009 07:34 AM

I'd say the working directory is set to your home dir or something when you click it open. I'd say it inherits the X's home dir.
When you launch the app from command line it uses the launch dir as home dir and that's why the images work.
Perhaps check the image paths in your app and change the working directory in it.

maresmasb 04-19-2009 04:39 PM

When starting from the commandline you give the executable path explicitly: in ./project5 you have the '.' part that identifies the current directory.
A double-click launch from the Desktop behaves quite like using cron jobs: you need to use full pathnames to make it work right. This is a bit weird, actually, because window managers could just as well handle this issue for you, but they don't. A nice programming task could this be for all the open source desktops all around the world.


All times are GMT -5. The time now is 03:18 PM.