Πόσο καλά τα πάει ο gcc με τα templates;
Christos Ricudis
ricudis at komodino.itc.auth.gr
Wed May 3 11:11:19 EEST 2006
Antonis Christofides wrote:
>>>>> Διακόψτε με αν λέω βλακείες αλλά με ο 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++.
>
Mprabo. To opoio wstoso den erxetai se antifash me to :
Options Controlling the Kind of Output
Compilation can involve up to four stages: preprocessing,
compilation proper,
assembly and linking, always in that order. GCC is capable of
preprocessing and
compiling several files either into several assembler input
files, or into one
assembler input file; then each assembler input file produces an
object file,
and linking combines all the object files (those newly compiled,
and those spec-
ified as input) into an executable file.
For any given input file, the file name suffix determines what
kind of compila-
tion is done:
file.c
C source code which must be preprocessed.
file.cc
file.cp
file.cxx
file.cpp
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.
Bebaia, to 8ema den einai sto compilation, alla sto linking. Wstoso
8ymamai ston gcc 3.x na kanw compile C++ kwdika (otan htan pragmatikos
C++ kwdikas, dhladh ahdia epipedou 1 kai oxi ahdia epipedou 2 me
templates kai header files xwris .h extensions kai oti allo katebhke
stous narkomaneis tou ISO commitee) xrhsimopoiwntas to gcc frontend. I
consider this as a BUG and I PERSONALLY DEMAND FROM RMS TO IMMEDIATELY
FIX IT, OR ELSE.
--
Christos Ricudis ricudis at itc.auth.gr
Systems Administrator +30-2310-998656
IT Support Center
Aristotle University of Thessaloniki, GREECE
More information about the Linux-greek-users
mailing list