[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



> 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




 
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] *