Compiling using GCC
Results 1 to 3 of 3

Thread: Compiling using GCC

  1. #1
    Join Date
    Nov 2003

    Compiling using GCC

    I am totally new to using gcc. Can someone tell me how i would compile a file called file.c in gcc? Once I compile file.c will I have to run any other commands in order to run the compiled file that gcc made?


  2. #2
    Just a Virtualized Geek MrLinus's Avatar
    Join Date
    Sep 2001
    Redondo Beach, CA

    At the prompt type:

    gcc file.c -o file

    gcc = compiler
    file.c = file to compile
    -o = create output and send to..
    file = final compiled product

    Assuming no errors, to run it you'd type ./file
    Goodbye, Mittens (1992-2008). My pillow will be cold without your purring beside my head
    Extra! Extra! Get your FREE copy of Insight Newsletter||MsMittens' HomePage

  3. #3
    Senior Member
    Join Date
    Nov 2001
    if its a windows system your working on the "-o file" would be changed to "-o file.exe" or whatever namne you want to give the exe

    of course then you'd call the file by path and name to run it (c:\gcc\projects\file or whatever)
    Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts