Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've been teaching myself to write programs in C, using Geany as my IDE.

All of my programs get compiled and linked correctly, and they seem to work fine when I test run them inside of the IDE, however I can't seem to run to program without the use of the IDE.

I've tried using the terminal command ./[filename]

However, I always get this response from the terminal:

bash: ./variabletest: No such file or directory

Any idea why this doesn't work? Simply clicking on the executable's icon doesn't work either.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

./variabletest requires the file you are running to be in the current directory. Run ls and see if variabletest is displayed, if not, cd to the directory where it is stored the run the program from there. If you are not sure where your file is located, run

readlink -f (nameoffile here).

This command will show you the path to your file for example you can have

/var/www/nameoffile

as the output. You the need to

cd /var/www

then run your programme from there.

share|improve this answer
    
I think I understand what you are saying, though I'm not certain how to implement it. I apologize but I'm pretty new to all this. –  Clark Sep 15 '13 at 9:22
    
@Clark, i have edited with the intention of shedding more light –  sosytee Sep 15 '13 at 9:27
    
I've got it now. Thank you! –  Clark Sep 15 '13 at 9:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.