(Not sure if this is the right group to post to.) I have trouble linking this simple program using gcc 3.3 on Solaris 9. It links fine with gcc 3.3 on Linux. What could be the problem? Thanks. #include <string> int main(void) { std::string x="a"; std::string y="b"+x; // this does not work std::string z=std::string("b)"+x; // this works return 0; } g++ a.cc The error is: Undefined first referenced symbol in file std::basic_string<char, std::char_traits<char>, std::allocator<char> >::replace(__gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, char const*, char const*)/var/tmp//ccfVrSsO.o ld: fatal: Symbol referencing errors. No output written to a.out collect2: ld returned 1 exit status