Add -lstdc++ to the link line for C++ programs.