Next: Compiling A Multi-Source C
Up: Compiling A C Program
Previous: Compiling A C Program
- code1 - Once we created the program, we wish to run it. This is usually done by simply typing its name. However, this requires that the current directory be in our PATH (which is a variable telling our Unix shell where to look for programs we're trying to run).
- ./code1 - In many cases, this directory is not placed in our PATH. This time we explicitly told our Unix shell that we want to run the program from the current directory.
- However, yet one more obstacle could block our path - file permission flags.
ls -al code1
chmod u+rwx code1 - we set the permissions of the file properly. This means the user ('u') should be given ('+') permissions read ('r'), write ('w') and execute ('x') to the file 'code1'.
ls -al code1
kdevelop code1.c
Cem Ozdogan
2009-07-03