Start C++ console app from shell file

Arch linux OS

1. I have compiled my program successfully.
2. Open Xterm - cd to proper directory which contains the executable and supporting data .txt files and the program runs smoothly.
3. Open gedit and entered

/usr/bin/xterm -fullscreen -e /home/k2/build-Pattern_football-Desktop-Debug/Pattern_football

and save it as

when i double click the pattern program opens - some correct data then quickly flashes up and then the xterm window disappears or exits.

After putting in some pauses I have discovered that it is not retrieving data from the .txt files?

All the .txt data files are in the /home/k2/build-Pattern_football-Desktop-Debug/ folder

what does one put in his shell so the needed data files are accessible???
Last edited on
I'll suppose that you are using relative paths, ┬┐what does `getcwd()' say?

As a convention, data files should be located in
Last edited on
As soon as I read Relative Paths I put changed my shell file to
cd /home/k2/build-Pattern_football-Desktop-Debug/

/usr/bin/xterm -fullscreen -e /home/k2/build-Pattern_football-Desktop-Debug/Pattern_football

works like a charm
Topic archived. No new replies allowed.