g++ problems

Chuck Hallenbeck chuckh at sent.com
Thu Apr 1 16:21:28 EST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 1 Apr 2004, Tom and Esther Ward wrote:

> Actually, I don't think g++ cares about the file extention as I have used
> cxx, cpp, cc, and it compiled them just the same.


Here is what the man page says:

For any given input file, the file name suffix determines
       what kind of compilation is done:

       file.c
           C source code which must be preprocessed.

       file.i
           C source code which should not be preprocessed.

       file.ii
           C++ source code which should not be preprocessed.

       file.m
           Objective-C source code.  Note that you must link with
           the library libobjc.a to make an Objective-C program
           work.

       file.mi
           Objective-C source code which should not be prepro-
           cessed.

       file.h
           C header file (not to be compiled or linked).

       file.cc
       file.cp
       file.cxx
       file.cpp
       file.c++
       file.C
           C++ source code which must be preprocessed.  Note that
           in .cxx, the last two letters must both be literally
           x.  Likewise, .C refers to a literal capital C.

       file.f
       file.for
       file.FOR
           Fortran source code which should not be preprocessed.

       file.F
       file.fpp
       file.FPP
           Fortran source code which must be preprocessed (with
           the traditional preprocessor).

       file.r
           Fortran source code which must be preprocessed with a
           RATFOR preprocessor (not included with GCC).
       file.ads
           Ada source code file which contains a library unit
           declaration (a declaration of a package, subprogram,
           or generic, or a generic instantiation), or a library
           unit renaming declaration (a package, generic, or sub-
           program renaming declaration).  Such files are also
           called specs.

       file.adb
           Ada source code file containing a library unit body (a
           subprogram or package body).  Such files are also
           called bodies.

       file.s
           Assembler code.

       file.S
           Assembler code which must be preprocessed.

       other
           An object file to be fed straight into linking.  Any
           file name with no recognized suffix is treated this
           way.

        You can specify the input language explicitly with the -x
       option:

       -x language
           Specify explicitly the language for the following
           input files (rather than letting the compiler choose a
           default based on the file name suffix).  This option
           applies to all following input files until the next -x
           option.  Possible values for language are:

                   c  c-header  cpp-output
                   c++  c++-cpp-output
                   objective-c  objc-cpp-output
                   assembler  assembler-with-cpp
                   ada
                   f77  f77-cpp-input  ratfor
                   java


       -x none
           Turn off any specification of a language, so that sub-
           sequent files are handled according to their file name
           suffixes (as they are if -x has not been used at all).



- -- 
The Moon is Waxing Gibbous (85% of Full)
In a world without Fences or Walls no one needs Windows or Gates.
My home page is now at http://www.mhcable.com/~chuckh
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iQCVAwUBQGyH5DVdG8M9x9tGAQIw1wQA4+A5vqOGFqQHiOOV27xYosyhVNGFJ2hw
28KFEbZ2y5y9/b6SdKnyRfiUpGioqgwWps5Dawijxacm8dw7sPrK1PhZB//S0Bfa
XtmBn8kSaDyq+BTzlssqnOn3CvD1NZ/TAOBhTmFm6A3TzP6XuP0RoVoVsHE6NAZ0
W+WANpEfZSY=
=aK/u
-----END PGP SIGNATURE-----





More information about the Speakup mailing list