[uClibc]Compile C++ code error

Steve Tsai startec at ms11.hinet.net
Mon Dec 9 10:40:11 UTC 2002


I got the following error message when I use gcc toolchain 2.95 from 
uClibc to compile upnp program. The STLport library can not link some 
functions in uClibc. I compiler uClibc as a mmu-less library, so I use 
vfork first, but I got "undefined reference to `vfork(void)'". When I 
use fork function , I got undefined reference to `__libc_fork'. How can 
I fix the problem? Thanks.

Steve Tsai


/tmp/toolchain/arm-linux/bin/gcc -Os  -Dlinux -D__linux__ -Dunix -DEMBED 
-I/root/uClinux-dist/uClibc/include  -I/root/uClinux-dist -fno-builtin 
-nostartfiles -I/root/uClinux-dist/linux-2.4.x/include -Wall -g -O2 -Os  
-Dlinux -D__linux__ -Dunix -DEMBED -I/root/uClinux-dist/uClibc/include  
-I/root/uClinux-dist -fno-builtin -nostartfiles 
-I/root/uClinux-dist/linux-2.4.x/include -Wall -g -O2 -Wl,-elf2flt 
/root/uClinux-dist/uClibc/lib/crt0.o 
/root/uClinux-dist/uClibc/lib/crti.o 
/root/uClinux-dist/uClibc/lib/crtn.o  gate.o gateway.o sample_util.o 
ipcon.o portmap.o pmlist.o -L./ ../bin/libupnp.a -lpthread -luuid 
-lstdc++ -lgcc  -o  upnpd
/tmp/toolchain/arm-linux/lib/libstdc++.a(locale_impl.o): In function 
`_STL::locale::global(_STL::locale const &)':
locale_impl.o(.text+0xab8): the 'setlocale' function supports only 
C|POSIX locales
upnpd.elf2flt: In function `global destructors keyed to 
PortMapList::PortMapList(void)':
/tmp/toolchain/include/c++/stl/_alloc.h:253: undefined reference to 
`__libc_fork'
collect2: ld returned 1 exit status
make: *** [upnpd] Error 1





More information about the uClibc mailing list