[SDL] SDL Linux Help
Paul Duffy
odubtaig at yahoo.co.uk
Thu Apr 26 09:15:20 PDT 2007
On Wed, 2007-04-18 at 09:27 +0200, millenomi wrote:
> On 4/18/07, Paulo Pinto <pjmlp at progtools.org> wrote:
> > Hi,
> >
> > just use getcwd() to get the current path.
>
> It won't work, as it will fail the same way it does currently (if the
> BMP he's trying to load is not in the current directory, it'll fail to
> load).
> dirname(argv[0]) is usually the way to go (this does not remove load
> checks as argv[0] can be modified, but one can count on the fact that
> barring bizarre exec()s it'll be correct for users launching the app
> in usual ways).
>
Whoo, I can't believe no-one's answered this correctly yet.
You're using relative paths which rely on the current working directory
(CWD) being the one the program is run from but when you click on a
binary in konqueror the CWD is _always_ your home directory. Best way to
get around this for the time being is to create a shortcut next to it
and specify the CWD in Work Directory.
Right click on the background of the folder and choose create new >>
link to application.
Name it under the General tab, go to the Application tab and:
- name it again
- put the full execution path and executable name in the Command field
- put the full path of the directory it lives in, in Work Path
Select OK and run it through this shortcut from now on.
___________________________________________________________
All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC Magazine
http://uk.docs.yahoo.com/nowyoucan.html
More information about the SDL
mailing list