= The charm of Sun's Freeware collection Presented on a stock install Solaris 9: $ cat hello.cpp #include main() { cout << "Hello World!\n"; } $ g++ hello.cpp $ ./a.out ld.so.1: a.out: fatal: libstdc++.so.2.10.0: \ open failed: No such file or directory Killed (Line wrapping added for clarity.) To get the Sun Freeware g++ working, the magic solution is '_g++ -Wl,-R/opt/sfw/lib ..._', which adds _/opt/sfw/lib_ (where the necessary g++ internal library is) to the runtime shared library lookup path. The irony here is that the Sun Freeware g++ has already been configured to look in _/opt/sfw/lib_ (or it would report a compile time error about not being able to find the library). But nobody went the extra step to add it to the default runtime path, and no one bothered to test the Freeware g++ before they shipped it. If I have to use g++ on Solaris much, I expect I'll just write a cover script for gcc and g++ that just always adds that argument. (Or replace the g++ version entirely, since it is gcc 2.95.3.) ~~Update~~: courtesy of the [[htdig FAQ http://www.htdig.org/FAQ.html#q3.6]], another workaround is to set the ((LD_RUN_PATH)) environment variable to _/opt/sfw/lib_ when you compile stuff.