This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: IBM AIX: ERROR: Undefined symbol basic_ostream


Please don't top-post.

Kaushik Chakraborty writes:
 > Andrew wrote:
 > > Your gcc isn't properly installed.  You need to make
 > > sure you have g++
 > > and libstdc++ from the same release.
 > 
 > When you say your gcc isn't properly installed, if could you please
 > clarify on that. As already mentioned I am using gcc (version
 > 4.0.0).
 > 
 > I believe, both g++ and libstdc++ are installed from the same
 > release, if there is any way to verify the same.

Not really, no.  It depends on where you got them from.  Find that
out and we can proceed.  Did you install it yourself?

I'm guessing that either there is an incompatibility with the
versions, or that the compiler and libs were built with a different OS
release.

Out of interest, why are you using 4.0.0?

Andrew.


 > --- Andrew Haley <aph@redhat.com> wrote:
 > 
 > > Kaushik Chakraborty writes:
 > >  > I can compile a hello world program. 
 > >  > $> cat hello.cc 
 > >  > #include <iostream> 
 > >  > 
 > >  > int main(int argc, char *argv[]) 
 > >  > { 
 > >  >   printf("Hello, world!\n"); 
 > >  >   std::cout << "Hello, world!\n"; 
 > >  > } 
 > >  > 
 > >  > $> g++ -c hello.cc 
 > >  > 
 > >  > $> ls -l hello.o 
 > >  > -rw-r--r-- 1 xxxxxxxx xxxxxxx 2528 11 Dec 12:23
 > >  > hello.o 
 > >  > 
 > >  > I can't link the hello world program. 
 > >  > 
 > >  > $> g++ -o hello hello.o 
 > >  > 
 > >  > throws me this error, 
 > >  > 
 > >  > ld: 0711-317 ERROR: Undefined symbol:
 > >  > .std::basic_ostream<char, std::char_traits<char>
 > > >&
 > >  > std::opera 
 > >  > tor<< <std::char_traits<char>
 > >  > >(std::basic_ostream<char, std::char_traits<char>
 > > >&,
 > >  > char const*) 
 > >  > ld: 0711-345 Use the -bloadmap or -bnoquiet
 > > option to
 > >  > obtain more information. 
 > >  > collect2: ld returned 8 exit status 
 > >  > 
 > >  > I am using following gcc version, 
 > >  > 
 > >  > gcc version 4.0.0 
 > >  > 
 > >  > I am on AIX5.3 box and "ld" version is LD 1.64
 > >  > (08/19/2003)
 > >  > 
 > >  > I do have libstdc++.a present in my system and I
 > > even
 > >  > tried building linking the library as, 
 > >  > 
 > >  > $> g++ -o hello hello.o -L/usr/lib -lstdc++ 
 > >  > 
 > >  > but eventually it gives me the same error. 
 > >  > 
 > >  > Help from anyone would be appreciated.
 > > 
 > > Your gcc isn't properly installed.  You need to make
 > > sure you have g++
 > > and libstdc++ from the same release.
 > > 
 > > Andrew.
 > > 
 > 
 > 
 > __________________________________________________
 > Do You Yahoo!?
 > Tired of spam?  Yahoo! Mail has the best spam protection around 
 > http://mail.yahoo.com 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]