Πόσο καλά τα πάει ο gcc με τα templates;

Antonis Christofides anthony at itia.ntua.gr
Wed May 3 09:29:32 EEST 2006


> >>> Διακόψτε με αν λέω βλακείες αλλά με ο gcc είναι ο c compiler.
> >>> Εσύ θές c++, άρα
> >>> g++  -c wastage1d.cpp
> >
> > Εγώ πάλι γιατί έχω την εντύπωση ότι το gcc είναι frontend και

Από το man gcc (σε ubuntu breezy, gcc 4.0.2):

Compiling C++ Programs

C++ source files conventionally use one of the suffixes .C, .cc, .cpp,
.CPP, .c++, .cp, or .cxx; C++ header files often use .hh or .H; and
preprocessed C++ files use the suffix .ii.  GCC recognizes files with
these names and compiles them as C++ programs even if you call the
compiler the same way as for compiling C programs (usually with the
name gcc).

However, C++ programs often require class libraries as well as a
compiler that understands the C++ language---and under some circum-
stances, you might want to compile programs or header files from
standard input, or otherwise without a suffix that flags them as C++
programs.  You might also like to precompile a C header file with a .h
extension to be used in C++ compilations.  g++ is a program that calls
GCC with the default language set to C++, and automatically specifies
linking against the C++ library.  On many systems, g++ is also
installed with the name c++.




More information about the Linux-greek-users mailing list