Using gcc

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • harhsa vardhan

    Using gcc

    i have downloaded the gcc now what i have to do to use the gcc to compile the programs tell me clearly whether it requires any installation
  • Nepomuk
    Recognized Expert Specialist
    • Aug 2007
    • 3111

    #2
    Hello Harhsa Vardhan!

    With most Linux distributions, you can install gcc via a package management system (in Debian, Ubuntu and related systems, use apt-get, in Red Hat, Fedora and CentOS it would be yum and in other distros you'll just have to check). That way, the package manager will set everything up for you.

    If you downloaded the binaries, you should have an executable file called gcc, which you can just run with it's (relative or absolute) path, though this isn't the most elegant solution.

    Anyway, when it is installed or otherwise available, you can use it like such:
    Code:
    g++ source.cpp
    There are other options of course, but you should read about them on the gcc man page (man gcc), as to explain them here would be too complicated.

    Greetings,
    Nepomuk

    Comment

    Working...