Say I have some guy's library (.a) which was compiled using g++-3.3. I have code that links against it, but I'd like to compile my code using g++-4, and use the version 4 linker. Is this allowed? If so, is stuff like this bound to happen and how do you avoid it?
I get a clean compile if I uses 3.3 for everything, but if I use the guy's library (which is kind of crappy and not easily compilable under g++-4) then I get the above kind of thing during linkage. (It could also be that the linking trouble is related to my code (some use of templates, for instance), which is the other thing I'm trying to sort out.)
Code:
/usr/bin/ld: Undefined symbols:
std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage
__ZNSt15basic_streambufIcSt11char_traitsIcEED4Ev
__ZNSt15basic_streambufIcSt11char_traitsIcEEC4Ev
std::__default_alloc_template<true, 0>::deallocate(void*, unsigned long)
std::__default_alloc_template<true, 0>::allocate(unsigned long)
collect2: ld returned 1 exit status