I'm trying to run my first C++ program on Solaris. Just a simple Hello World program. When I try to run. I get the error
libstdc++.so.6:open failed:No such file or directory. Of course I did some googling and found out that I can solve this by setting the environment variable:
After relog, I found out that it was not a permanent way to solve it. I'm guessing this have something to do with linking the libstdc++.so.6 during compile. Here are the step that I did from the beginning:
bash-3.2# gcc -c test.cpp bash-3.2# gcc -o test test.o -lstdc++ bash-3.2# ./test libstdc++.so.6:open failed:No such file or directory bash-3.2# ldd test | grep not libstdc++.so.6 => (file not found) bash-3.2# /usr/ccs/bin/elfdump test | grep RUNPA bash-3.2# find /usr -name libstdc++.so.6 /usr/local/lib/libstdc++.so.6
Did I miss a flag or something during compile? How do I create a softlink so that it knows where to look for when running that program?
This is the platform that I'm using:
bash-3.2# uname -a SunOS ms-sparc8 5.8 Generic_108528-13 sun4u sparc SUNW,Sun-Blade-100 bash-3.2# gcc -v Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.3.2/specs Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls --disable-libgcj --enable-languages=c,c++ Thread model: posix gcc version 3.3.2