Friday, July 31, 2009

CC Command in Linux?

i installed Redhat Linux 9.0 when i try to compile a c / c++ Programm i get the error BASH CC Command not Found

CC Command in Linux?
Bash is a shell where to input commands, execute things and get the outputs.





What the message is telling you is the shell is unable to locate an executable file with the name "cc" in the commands path.





Issue the command: which cc


It should answer either "cc wasn't found in the path" (or something like that), or give you the absolute path leading to the directory where the cc executable file is, i.e. the one it would use if invoked as a command.





There is a variable PATH holding all the paths were the shell have to look for commands. Each path is separated from the others with colons (:). If you want to execute a command in your current directory, you need the path to have the "self directory" reference, a dot, as one of those paths.





If you don't want to modify the PATH variable, you can write down the whole path (absolute or relative) and name. Should the cc were in the current directory, ./cc (dot dash cc) will execute it





Notice you require permission to execute a file, even if reachable trough the PATH. Permissions are issued to "all", to a "goup" or to the user owning the file. Should cc were installed by root, unless the root user were granting cc permissions for the group (you have to be part of the group) or to "all", you won't be able to execute it.


No comments:

Post a Comment