Hi, I am trying to compile a very simple C program but the commands I use are not working. eg $ gcc firstCProgram.c or $ cc firstCProgram.c bash: command gcc/cc not found
I seem to have some sort of c compiler on my system in the directory /usr/lib/gcc-lib/i586-suse-linux/3.3.1/cc1
Am I right in thinking this is a c compiler that I can use to compile my C programs? If yes, then how can I set the path so that it will work from the command line whenever I want to compile? I'm using SuSE 9.0. If this is not a C compiler after all, please tell me so and I'll install one. Regards,
On 12-Jan-04 Bryce Martin wrote:
Hi, I am trying to compile a very simple C program but the commands I use are not working. eg $ gcc firstCProgram.c or $ cc firstCProgram.c bash: command gcc/cc not found
I seem to have some sort of c compiler on my system in the directory /usr/lib/gcc-lib/i586-suse-linux/3.3.1/cc1
Am I right in thinking this is a c compiler that I can use to compile my C programs? If yes, then how can I set the path so that it will work from the command line whenever I want to compile? I'm using SuSE 9.0. If this is not a C compiler after all, please tell me so and I'll install one.
Hi Bruce,
the C compiler gcc (cc is a symbolic link to gcc) should be at /usr/bin/gcc and cc at /usr/bin/cc.
So check whether these files exist. If not, then you need to install gcc/cc. You should find it under the "development" group of packages. Also check out whether you only need the "basic" gcc install, or whether you also need (or would like to have) any "extras" from the "development" set.
The files under /usr/lib/gcc-lib/i586-suse-linux/3.3.1 will be dynamically linkable library nodules from the C compiler which some installed programs will need to have available in order to run.
If you don't have gcc as a binary executable in its own right, you won't be able to compile any C program.
(I'm a bit surprised gcc was not installed by default. Time was when it was assumed that anyone running Linux would neeed it!)
I hope this helps, Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@nessie.mcc.ac.uk Fax-to-email: +44 (0)870 167 1972 Date: 12-Jan-04 Time: 21:33:52 ------------------------------ XFMail ------------------------------
Hi Bryce
The compiler is usually found in /usr/bin by the name of gcc - There is often a symlink cc pointing to gcc.
To compile your source file, use: gcc firstCProgram.c -o firstProgram
Regards, Paul.
On Monday 12 January 2004 9:15 pm, Bryce Martin wrote:
I seem to have some sort of c compiler on my system in the directory /usr/lib/gcc-lib/i586-suse-linux/3.3.1/cc1
On Monday 12 Jan 2004 9:15 pm, Bryce Martin wrote:
Hi, I am trying to compile a very simple C program but the commands I use are not working. eg $ gcc firstCProgram.c or $ cc firstCProgram.c bash: command gcc/cc not found
I seem to have some sort of c compiler on my system in the directory /usr/lib/gcc-lib/i586-suse-linux/3.3.1/cc1
Am I right in thinking this is a c compiler that I can use to compile my C programs? If yes, then how can I set the path so that it will work from the command line whenever I want to compile? I'm using SuSE 9.0. If this is not a C compiler after all, please tell me so and I'll install one. Regards,
cc is the standard C name for the C compiler on *any* system. On my mandrake box cc is a link to gcc which is the gnu C compiler for linux. gcc itself is a link to /etc/alternatives/gcc which is a directory of links which takes care of the various invocations of gcc with C or C++ files for example - in which gcc points to the actual version of the gcc compiler on my system which is /usr/bin/gcc-3.2.2
To cut a long story short the linux C compiler is gcc so I suspect you may not have it installed. Use yast and search for gcc to install??
Ian