Thread: Compiling syntax

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    51

    Compiling syntax

    Sorry, this may be a newbie question..

    When compiling, for example g++ -c filename.cc....or
    g++ -o filename.o filename2.o

    what does the "-o" and "-c" do exactly?

    is there a help command where i can see all the available options for compiling and get more information?

    maybe like "help g++" (I've tried that, didn't work ....)

  2. #2
    Blank
    Join Date
    Aug 2001
    Posts
    1,034
    man g++ or info g++

  3. #3
    Registered User matheo917's Avatar
    Join Date
    Sep 2001
    Posts
    279
    (gcc) invokes a compiler which turns your source code into an object (o) file...

    (gxx) invokes a linker which in turn transforms your object files (o) into an executeable file (exe)

    hope that helps...

    Regards,
    matheo917

  4. #4
    Fingerstyle Guitarist taylorguitarman's Avatar
    Join Date
    Aug 2001
    Posts
    564
    The defualt executable filename after you compile is a.out, the -o flag lets you choose the executable filename.
    To find out about all of the options for gcc try:
    man gcc
    or
    gcc --h
    If a tree falls in the forest, and no one is around to see it, do the other trees make fun of it?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  2. more then 100errors in header
    By hallo007 in forum Windows Programming
    Replies: 20
    Last Post: 05-13-2007, 08:26 AM
  3. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  4. Using VC Toolkit 2003
    By Noobwaker in forum Windows Programming
    Replies: 8
    Last Post: 03-13-2006, 07:33 AM
  5. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM