[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] Re: [NOVICE] C++



Frank Damgaard <sslug@sslug> skrev den 09-May-01:

> Jeg har nu ikke været ude for dette problem, c++ std. biblioteket
> bør automatisk være med, hvis man ikke har sat andre forkerte
> options på oversætter/linker eller glemt include filer.

Glemte include filer giver ikke linkerfejl; de ukendte symboler bliver
fanget af compileren.

gcc linker ikke automatisk med libstdc++, men g++ gør:

sslug@sslug and]$ cat test.cc 
#include <iostream>
int main() { cout << "hej verden" << endl; }
sslug@sslug and]$ g++ test.cc -o test
sslug@sslug and]$ gcc test.cc -o test
/tmp/ccYXfunR.o: In function `main':
/tmp/ccYXfunR.o(.text+0xa): undefined reference to `endl(ostream &)'
/tmp/ccYXfunR.o(.text+0x17): undefined reference to `cout'
/tmp/ccYXfunR.o(.text+0x1c): undefined reference to `ostream::operator<<(char const *)'
/tmp/ccYXfunR.o(.text+0x27): undefined reference to `ostream::operator<<(ostream &(*)(ostream &))'
collect2: ld returned 1 exit status
sslug@sslug and]$ 

-- 
Stor hilsen -- Anders


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