This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Help installing GCC
- From: Jie Zhang <jie dot zhang at analog dot com>
- To: Andrew Polyak <apolyak at sio dot midco dot net>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 4 Jan 2010 11:28:40 +0800
- Subject: Re: Help installing GCC
- References: <20100103204725.suem05d1qo8wksgk@mail.midco.net>
On 01/04/2010 10:47 AM, Andrew Polyak wrote:
Hi.
I'm trying to install GCC on my Kubuntu system.
I downloaded it through the software manager and ran a .deb file.
I believe that it is installed, but I don't know how to run it.
First try
$ gcc --version
It should print out something like
gcc (Debian 4.4.2-8) 4.4.2
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Then use your favorite editor to edit a file named hello.c
$ cat hello.c
#include <stdio.h>
int main ()
{
printf ("Hello GCC!\n");
return 0;
}
Compile it to an executable using GCC:
$ gcc -o hello hello.c
Run the executable:
$ ./hello
Hello GCC!
Finally you can further read GCC manual:
http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/
Jie