uClibc++ application compilation error

manjunatha sirinivasan manju903srini at yahoo.co.in
Sat Sep 23 12:21:29 UTC 2006

   Iam facing the problem  of compiling a C++ code
with  the cross C++ compiler  of montavista

Iam  getting the following  error on linking by the
command line:
mips_fp_be-g++ -nostdlib -nodefaultlibs 
-L /opt/montavista/pro/devkit/mips/fp_be/target/lib

 hello.cpp -o hello


/tmp/cceiCJbd.o(.text+0x24): In function `main':
: undefined reference to `std::cout'
/tmp/cceiCJbd.o(.text+0x34): 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*)'
undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status

The library path refered at :

Under  this library path  I have shared library
libraries of libc.so.0 (for uClibc), uClibc++.so,
uClibc++.a, crt1.o crti.o. I think this is sufficient
for linking. 

My hello.cpp has the 

#include <iostream>
#include <stdio.h>
using namespace std;
using std::cout;
using std::endl;
int main()
std :: cout<<"Hello World \n";
    return 0;

Let me know if iam  doing any mistake, for linking. 
Please find me the solution as early as possible. 
Manjunatha Srinivasan N

  Manjunatha Srinivasan N

Yahoo! India Answers: Share what you know. Learn something new

More information about the uClibc mailing list