This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Help installing GCC


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]