gcc pathing problem?

Ben Miller wheelscribe at gmail.com
Wed Jun 15 11:57:19 UTC 2005

On Wednesday 15 June 2005 6:40 am, Morten W. J. wrote:
> On Wednesday den 15. June 2005 13:27, Ben Miller wrote:
> > I'm pretty much a C++ novice, so any help is much appreciated.
> So are a piece of your commands and the output from make/gcc if you want us
> to help. ;-)
> --
> Morten W. Jørgensen

Thanks, Morten. 

Code sample -as you can see, it's definitely learning material:
#include <iostream.h>

int main() 
// cout << "The size of an int is: \t\t"  <<  sizeof(int)  << "bytes\n";
 cout << "The size of a short\t\t"   <<  sizeof(short) << "bytes\n";
 cout << "The size of a long is: \t\t"  <<  sizeof(long)<<  "bytes\n";
 cout << "The size of a char is: \t\t"  <<  sizeof(char) << "bytes\n";
 cout << "The size of a float is: \t\t" <<  sizeof(float) << "bytes\n";
 cout << "The size of a double is: \t\t" <<  sizeof(double) << "bytes\n";

 return 0;


error messages:
/tmp/ccQdYUi7.o(.text+0x55): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& 
std::operator<< <std::char_traits<char> >(std::basic_ostream<char, 
std::char_traits<char> >&, char const*)'

The error is longer, but it repeats the same message for each call to cout.

Thanks very much,

More information about the ubuntu-users mailing list