I'm attempting to compile the following test application:
#include <string>
#include <iostream>
int main(void) {
std::string s;
std::getline(std::cin, s);
std::cout << s << std::endl;
return 0;
}
When compiled with:
CC -std=c++03 -m64 getline.cpp
Everything is fine, however when compiled with:
CC -std=c++11 -m64 getline.cpp
I'm seeing the following linker failure:
Undefined first referenced
symbol in file
std::getline<char, std::char_traits<char>, std::allocator<char> > getline.o
ld: fatal: symbol referencing errors. No output written to a.out
Is there something additional needed on the compilation line when linking with C++11?