FAQ: libstdc++ missing
When I run Sawmill, I get an error: './sawmill: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory'. What's going on?
Short Answer
Sawmill requires the libstdc++ library. This is available by default on many platforms, and is included in the Sawmill distribution on others (including Solaris)
Long Answer
Sawmill requires the libstdc++ library. This is available by default on many platforms, but it is not available on some older platforms, and it is often not available on Solaris. There are several ways of making this available:
-
Install the g++ compiler. This is available for all platforms from GNU. g++ is also available as a package (e.g. a Red Hat RPM) for most platforms, and is available as an installation option on most platforms. libstdc++ is part of the g++ compiler, so installing it will install libstdc++.
OR
-
Use the libstdc++ included with Sawmill. On Solaris, the standard download of Sawmill includes the libstdc++ file (whose name starts with libstd++). If you have root access, the easiest way to install this is to copy it to /usr/lib. If you don't, you can set the environment variable LD_LIBRARY_PATH to point to your Sawmill installation. For instance, if your Sawmill installation is at /usr/sawmill, you can run this:
setenv LD_LIBRARY_PATH "$LD_LIBRARY_PATH:/usr/sawmill" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/sawmill"
to add /usr/sawmill to the end of the LD_LIBRARY_PATH variable. You'll only need one of these two commands (the first if you're using csh as your shell, and the second if you're using bash), but it won't hurt to run them both if you're not sure which to use; you'll just get a harmless error message from the wrong one.
These commands will last for one command-line session. If you need to make this change permanent, you can add the pathname to a separate line in the /etc/ld.conf file, or you can add the command above to your one of your login scripts (e.g. .login, .cshrc, .bashrc).
After setting LD_LIBRARY_PATH, you should be able to run Sawmill
OR
-
Find an existing libdstdc++ on your system. It is possible that you do have libstdc++ installed on your system, but it's not in your LD_LIBRARY_PATH. If that's the case, you can add the location of libstdc++ to the LD_LIBRARY_PATH using the instructions above. For instance, if it is in /usr/local/lib, you can add that to LD_LIBRARY_PATH to use it.