uClibc++ application compilation error

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


Hi 
   Iam facing the problem  of compiling a C++ code
with  the cross C++ compiler  of montavista
(mips_fp_ge-g++). 

Iam  getting the following  error on linking by the
command line:
mips_fp_be-g++ -nostdlib -nodefaultlibs 
-Wl,-rpath=/opt/montavista/pro/devkit/mips/fp_be/target/lib
-L /opt/montavista/pro/devkit/mips/fp_be/target/lib
-lc
/opt/montavista/pro/devkit/mips/fp_be/target/lib/crt1.o
/opt/montavista/pro/devkit/mips/fp_be/target/lib/crti.o

/opt/montavista/pro/devkit/mips/fp_be/target/lib/crtn.o
 hello.cpp -o hello

Error-----  

/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*)'
/tmp/cceiCJbd.o(.gnu.linkonce.d.DW.ref.__gxx_personality_v0+0x0):
undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
-----------

The library path refered at :
/opt/montavista/pro/devkit/mips/fp_be/target/lib

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";
printf("asdf");
                                                      
                                                      
               
    return 0;
}

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








  Regards,
   
  Manjunatha Srinivasan N




		
__________________________________________________________
Yahoo! India Answers: Share what you know. Learn something new
http://in.answers.yahoo.com/



More information about the uClibc mailing list