[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [cobalt-developers] GCC and C++ on my cobalt - cant use iostr	eam.h library??
- Subject: RE: [cobalt-developers] GCC and C++ on my cobalt - cant use iostr	eam.h library??
 
- From: Mat Schaffer <mschaffer@xxxxxxxxxxxxxxxxxxx>
 
- Date: Fri Feb  2 13:05:18 2001
 
- List-id: Discussion Forum for developers on Cobalt Networks products <cobalt-developers.list.cobalt.com>
 
use the compile command:
g++ test.cpp -o test
I'm no veteran, but I think that'll fix the problem.
> -----Original Message-----
> From: Kevin D [mailto:kdlists@xxxxxxxxxxxxxxx]
> Sent: Friday, February 02, 2001 14:33
> To: cobalt-developers@xxxxxxxxxxxxxxx
> Subject: [cobalt-developers] GCC and C++ on my cobalt - cant use
> iostream.h library??
> 
> 
> I am a veteran windows/dos C++ programmer but new to C++ 
> programming on
> linux (been doing Perl scripting up until now). I put 
> together a small C++
> program as a test:
> 
> #include<iostream.h>
> 
> void main() {
> cout << "The dog ate my linux book.";
> }
> 
> And compiled using:
> gcc test.cpp -o test
> 
> And I got the following errors:
> 
> /tmp/ccurlyjh.o: In function `main':
> /tmp/ccurlyjh.o(.text+0x9): undefined reference to `cout'
> /tmp/ccurlyjh.o(.text+0xe): undefined reference to 
> `ostream::operator<<(char
> const *)'
> collect2: ld returned 1 exit status
> 
> I have tried this with various variations, including adding 
> the following
> lines to the program (as per GCC FAQ): "using std::cout;" 
> and/or "using
> namespace std;" to no avail.
> 
> I've also read that GCC won't link to libraries not compiled 
> by GCC. Could
> it be that the C++ libraries for iostream weren't compiled using GCC?
> 
> If not, what is the deal?
> 
> Kevin
> 
> _______________________________________________
> cobalt-developers mailing list
> cobalt-developers@xxxxxxxxxxxxxxx
> http://list.cobalt.com/mailman/listinfo/cobalt-developers
>