Du skal kompilere og linke C++ kode med g++ , ikke gcc . Ellers bliver C++ standardbibliotekerne ikke linket korrekt.