[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] problemer med at linke til iostream



On Thu, 18 May 2000, Nils Åke Ljunggren wrote:

> > Du skal linke med standard biblioteket:
> >
> > % g++ -lstdc++ -o cpptest cpptest.cpp
> 
> Afhængigt af compileren:
> # g++ -o hejtest hejtest.cc
> er at foretrække da efternavnet .cc er standard for gnu c++
> 
> nogle versioner accepterer:
> # g++ -o hejtest hejtest.C
> # g++ -o hejtest hejtest.cpp
> # g++ -o hejtest hejtest.c              (sic!)
> 
> eller endog
> # gcc -lstdc++ -o hejtest hejtest.cc
> 
> Jeg mener også at have oplevet (her er jeg dog ikke 100% sikker) en version
> hvor
> # gcc -o hejtest hejtest.cc
> automatisk linkede med stdc++
> 
> Det ser ud til at efternavnet er vigtigt og afhængigt af compileren:
> (men uafhængigt af platform (forbehold: HP))
> brug
> .cc med gnu g++/evt. gcc/djgpp
> .C for HP
> .cpp med Borland
> 
> Hej fra Nils
> 
> 

Jeg ved ikke hvor du har det fra med de suffixes, men her er listningen
fra gcc man-siden:

.c    C source; preprocess, compile, assemble
.C    C++ source; preprocess, compile, assemble
.cc   C++ source; preprocess, compile, assemble
.cxx  C++ source; preprocess, compile, assemble

The C and C++  compilers  are  integrated.   Both  process
input  files  through  one or more of four stages: prepro-
cessing, compilation, assembly, and linking.  Source file-
name suffixes identify the source language, but which name
you use for the compiler governs default assumptions:


Det lader dog til at det er compilerkaldet gcc/g++ som afgør det.

Ang. linkningen med stdc++, så jo tidligere udgaver af g++ foretog selv
linkningen.

Jonas

Eml: sslug@sslug || ICQ: 62401545
WWW: http://hjem.wanadoo.dk/~wan17111/



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *