public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* building gcc-2.95.2 with libstdc++-2.90.8 library on RH 6.2
@ 2001-11-01 12:18 Manjunath H Bhajantri
  2001-11-01 21:14 ` Claudio Bley
  2001-11-02  5:02 ` Rupert Wood
  0 siblings, 2 replies; 3+ messages in thread
From: Manjunath H Bhajantri @ 2001-11-01 12:18 UTC (permalink / raw)
  To: gcc-help

Hello all,
  Please help me! I am trying to build gcc version 2.95.2 with
library libstdc++-2.90.8 on my red-hat linux 6.2 pc as one of
my software installation requires that configuration.
  But I am not able to build properly. Because my HelloWorld.cxx " #include
<iostream.h> int main() { cout <<"Hello, World!"<<endl;}" is not compiling,
giving the error /tmp/ccGZV1Sn.o: In function `main':
/tmp/ccGZV1Sn.o(.text+0xa): undefined reference to `endl(ostream &)'
/tmp/ccGZV1Sn.o(.text+0x17): undefined reference to `cout'
/tmp/ccGZV1Sn.o(.text+0x1c): undefined reference to `ostream::operator<<(char
const *)' /tmp/ccGZV1Sn.o(.text+0x27): undefined reference to
`ostream::operator<<(ostream &(*)(ostream &))' collect2: ld returned 1 exit
status                                                                         
                  I guess it is because of some namespace problem.  I searched
in the mailing list and found no help. If anybody has faced the same problem
and solved it please send it to me. TIA, Manjunath. -- 
Manjunath H Bhajantri
Software Engineer.
Phonologies Pvt(India) Ltd.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: building gcc-2.95.2 with libstdc++-2.90.8 library on RH 6.2
  2001-11-01 12:18 building gcc-2.95.2 with libstdc++-2.90.8 library on RH 6.2 Manjunath H Bhajantri
@ 2001-11-01 21:14 ` Claudio Bley
  2001-11-02  5:02 ` Rupert Wood
  1 sibling, 0 replies; 3+ messages in thread
From: Claudio Bley @ 2001-11-01 21:14 UTC (permalink / raw)
  To: manjunath; +Cc: gcc-help

>>>>> "Manjunath" == Manjunath H Bhajantri <manjunath@iitbombay.org> writes:

    Manjunath> Hello all, Please help me! I am trying to build gcc
    Manjunath> version 2.95.2 with library libstdc++-2.90.8 on my
    Manjunath> red-hat linux 6.2 pc as one of my software installation
    Manjunath> requires that configuration.  But I am not able to
    Manjunath> build properly. Because my HelloWorld.cxx " #include
    Manjunath> <iostream.h> int main() { cout <<"Hello,
    Manjunath> World!"<<endl;}" is not compiling, giving the error
    Manjunath> /tmp/ccGZV1Sn.o: In function `main':
    Manjunath> /tmp/ccGZV1Sn.o(.text+0xa): undefined reference to
    Manjunath> `endl(ostream &)' /tmp/ccGZV1Sn.o(.text+0x17):
    Manjunath> undefined reference to `cout'
    Manjunath> /tmp/ccGZV1Sn.o(.text+0x1c): undefined reference to
    Manjunath> `ostream::operator<<(char const *)'
    Manjunath> /tmp/ccGZV1Sn.o(.text+0x27): undefined reference to
    Manjunath> `ostream::operator<<(ostream &(*)(ostream &))'
    Manjunath> collect2: ld returned 1 exit status I guess it is
    Manjunath> because of some namespace problem.  I searched in the
    Manjunath> mailing list and found no help. If anybody has faced
    Manjunath> the same problem and solved it please send it to
    Manjunath> me. TIA, Manjunath. -- Manjunath H Bhajantri Software
    Manjunath> Engineer.  Phonologies Pvt(India) Ltd.

May I ask what your command line looks like?

Doesn't 'g++ HelloWorld.cxx' work?

Claudio

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: building gcc-2.95.2 with libstdc++-2.90.8 library on RH 6.2
  2001-11-01 12:18 building gcc-2.95.2 with libstdc++-2.90.8 library on RH 6.2 Manjunath H Bhajantri
  2001-11-01 21:14 ` Claudio Bley
@ 2001-11-02  5:02 ` Rupert Wood
  1 sibling, 0 replies; 3+ messages in thread
From: Rupert Wood @ 2001-11-02  5:02 UTC (permalink / raw)
  To: manjunath; +Cc: gcc-help

Manjunath H Bhajantri wrote:

> But I am not able to build properly. Because my HelloWorld.cxx
> "#include <iostream.h> int main() { cout <<"Hello, World!"<<endl;}"
> is not compiling, giving the error /tmp/ccGZV1Sn.o: In function
`main':
> /tmp/ccGZV1Sn.o(.text+0xa): undefined reference to `endl(ostream &)'

You're using:

    gcc HelloWorld.cxx

when you should be using:

    g++ HelloWorld.cxx

The g++ compiler driver will automatically link in the necessary C++
libraries.

There are no namespace problems with this code. However, <iostream.h>
has been deprecated in GCC 3.0+ in favour of <iostream> (which defines
everything in the 'std' namespace).

Hope that helps,
Rup.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-11-13 10:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-01 12:18 building gcc-2.95.2 with libstdc++-2.90.8 library on RH 6.2 Manjunath H Bhajantri
2001-11-01 21:14 ` Claudio Bley
2001-11-02  5:02 ` Rupert Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).