uClibc++ application compilation error

Khem Raj kraj at mvista.com
Mon Sep 25 17:02:47 UTC 2006


Manjunatha

You are using a gcc which is configured for glibc. Thats your biggest 
problem here. If you want to use uclibc then you should configure other 
toolchain components to be uclibc aware especially gcc and ld/binutils.

You can refer to buildroots toolchains and I would suggest that you 
build the complete toolchain configured correctly for uclibc.

Thanks

-Khem

manjunatha sirinivasan said the following on 09/23/2006 05:21 AM:
> 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/
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://busybox.net/cgi-bin/mailman/listinfo/uclibc
>   


-- 
Khem Raj
MontaVista Software Inc.
kraj at mvista.com




More information about the uClibc mailing list