Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Q] g++ header files




Hi,
I thought I would get our renewed discussion going with a question
on g++

I usually use standard c, but I went to the U.S. and bought a book
on c++ and tried to go through the first example "hello world" program
to make sure the compiler was working.  I am having a little trouble:

  cow:~/practice/c/cpp% g++ -I/usr/include/g++ hello.cc
  /tmp/cca001071.o(.text+0x1e): undefined reference to `cout'
  /tmp/cca001071.o(.text+0x23): undefined reference to 
  `ostream::operator<<(char const *)'


This is the sample program:

  #include <iostream.h>
  void main()
  {
        cout << "Hello, World.\n";
  }

When I first tried this, I was getting error messages from the stdiostream.h
header file that iostream.h was referencing.  

The gcc is:
  Reading specs from /usr/lib/gcc-lib/i486-linux/2.6.2/specs
  gcc version 2.6.2

The g++ libs are from the binary:
  libg++-2.6.2.5.bin.tar.gz

  Linux cow 1.2.9 #1

==

Should I try and compile the g++ libs from the source?

Regards,

Craig



-------------------------------------------------------------------------
     Craig Oda      12 40 82 A8 DF DD DD 30  BB 0E 26 22 E0 D8 F2 87         
     craig@example.com      Public Key: finger craig@example.com 
     phone: +81-3-3351-5977                   fax: 81-3353-6096
     Twics / IEC Building / 1-21 Yotsuya, Shinjuku-ku, Tokyo 160 Japan
     Now accepting resumes by postal mail.  CS or engineering degree required.
     send me e-mail for additional requirements.
-------------------------------------------------------------------------_



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links