Try adding -lstdc++ to the link line.