cc1plus: error while loading shared libraries: libstdc++.so.6: c

wangze
wangze@wangze:/opt/FriendlyARM/toolschain/4.4.3/bin⟫ arm-linux-gcc
~/main.cc -o ~/main-arm
/opt/FriendlyARM/toolschain/4.4.3/libexec/gcc/arm-none-linux-gnueabi/4.4.3/cc1pl
us:
error while loading shared libraries: libstdc++.so.6: cannot open shared
object file: No such file or directory
I use ubuntu 14.04 LTS 64-bit 
arm-linux-gcc-4.4.3.tgz (47.06 MB)
and 
$ sudo apt-get install build-essential automake autoconf libtool
$ sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0
wangze@wangze:/opt/FriendlyARM/toolschain/4.4.3/bin⟫ arm-linux-gcc
-v
Using built-in specs.
Target: arm-none-linux-gnueabi
Configured with:
/opt/FriendlyARM/mini2440/build-toolschain/working/src/gcc-4.4.3/configure
--build=i386-build_redhat-linux-gnu --host=i386-build_redhat-linux-gnu
--target=arm-none-linux-gnueabi --prefix=/opt/FriendlyARM/toolschain/4.4.3
--with-sysroot=/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-roo
t
--enable-languages=c,c++ --disable-multilib --with-arch=armv4t
--with-cpu=arm920t --with-tune=arm920t --with-float=soft
--with-pkgversion=ctng-1.6.1 --disable-sjlj-exceptions
--enable-__cxa_atexit --with-gmp=/opt/FriendlyARM/toolschain/4.4.3
--with-mpfr=/opt/FriendlyARM/toolschain/4.4.3
--with-ppl=/opt/FriendlyARM/toolschain/4.4.3
--with-cloog=/opt/FriendlyARM/toolschain/4.4.3
--with-mpc=/opt/FriendlyARM/toolschain/4.4.3
--with-local-prefix=/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sy
s-root
--disable-nls --enable-threads=posix --enable-symvers=gnu --enable-c99
--enable-long-long --enable-target-optspace
Thread model: posix
gcc version 4.4.3 (ctng-1.6.1) 
please help me,thanks

Sandeep Sondagar
apt-get install lib32stdc++6

wangze
thanks for your answer,it works.but
arm-linux-gcc ~/main.cc -o ~/main
more
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:147:
error: stray '\223' in program
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:147:
error: stray '\205' in program
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:147:
error: stray '\226' in program
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:147:
error: stray '\313' in program
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:147:
error: stray '\304' in program
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:147:
error: stray '\32' in program
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:147:
error: stray '\301' in program
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:147:
error: stray '\361' in program
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:147:
error: stray '\341' in program
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:147:
error: stray '\265' in program
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:147:
error: stray '\206' in program
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:147:
error: stray '\32' in program
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:147:
error: stray '\' in program
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:147:
error: stray '\327' in program
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:147:
error: stray '\361' in program
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:147:
error: missing terminating " character
In file included from
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/s
tdio.h:75,
                 from /home/wangze/main.cc:1:
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:148:
error: stray '\275' in program
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:148:
error: stray '\344' in program
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:148:
error: stray '\375' in program
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:148:
error: stray '\341' in program
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:148:
error: stray '\234' in program
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:148:
error: stray '\352' in program
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:148:
error: stray '\211' in program
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/l
ibio.h:148:
error: stray '\314' in program
In file included from
/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/include/s
tdio.h:75,
                 from /home/wangze/main.cc:1:
more
I found in the directory /sys-root/bin content many *.so file,did I need
let arm-linux-gcc know this directory?
thanks for your hardwork.

wangze
the main.cc 
#include <stdio.h>
int main()
{
  printf("hello");
  return 0;
}

Sandeep Sondagar
Did you added "PATH=$PATH:/opt/FriendlyARM/toolschain/4.4.3/bin" to .bashrc
file??

Post output of "echo $PATH" here.

wangze
wangze@wangze:/opt&#10219; echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/loc
al/games:/opt/FriendlyARM/toolschain/4.4.3/bin

wangze
thanks for you response.the error has been corrected.
the extracted file maybe had error.I extracted it again,it works fine now.

Renato Aloi
My Ubuntu 14.04 is 64 bits too. I've managed to cross-compile 32 kernel
only installing 32 libs for ncurses and for stdc++6. I think you need to do
same as I did:

sudo apt-get install lib32ncurses5 lib32stdc++6 lib32z1 lib32bz2-1.0

That should do the trick.