$ gcc test.cpp /tmp/ccAZX80i.o: In function `__gnu_cxx::new_allocator::deallocate(S*, unsigned int)': test.cpp:(.text._ZN9__gnu_cxx13new_allocatorI1SE10deallocateEPS1_j[__gnu_cxx::new_allocator::deallocate(S*, unsigned int)]+0xd): undefined reference to `operator delete(void*)' /tmp/ccAZX80i.o: In function `__gnu_cxx::new_allocator::allocate(unsigned int, void const*)': test.cpp:(.text._ZN9__gnu_cxx13new_allocatorI1SE8allocateEjPKv[__gnu_cxx::new_allocator::allocate(unsigned int, void const*)]+0x24): undefined reference to `std::__throw_bad_alloc()' test.cpp:(.text._ZN9__gnu_cxx13new_allocatorI1SE8allocateEjPKv[__gnu_cxx::new_allocator::allocate(unsigned int, void const*)]+0x32): undefined reference to `operator new(unsigned int)' /tmp/ccAZX80i.o: In function `std::vector >::_M_insert_aux(__gnu_cxx::__normal_iterator > >, S const&)': test.cpp:(.text._ZNSt6vectorI1SSaIS0_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS0_S2_EERKS0_[std::vector >::_M_insert_aux(__gnu_cxx::__normal_iterator > >, S const&)]+0x104): undefined reference to `std::__throw_length_error(char const*)' test.cpp:(.text._ZNSt6vectorI1SSaIS0_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS0_S2_EERKS0_[std::vector >::_M_insert_aux(__gnu_cxx::__normal_iterator > >, S const&)]+0x2dc): undefined reference to `__cxa_begin_catch' test.cpp:(.text._ZNSt6vectorI1SSaIS0_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS0_S2_EERKS0_[std::vector >::_M_insert_aux(__gnu_cxx::__normal_iterator > >, S const&)]+0x35a): undefined reference to `__cxa_rethrow' test.cpp:(.text._ZNSt6vectorI1SSaIS0_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS0_S2_EERKS0_[std::vector >::_M_insert_aux(__gnu_cxx::__normal_iterator > >, S const&)]+0x365): undefined reference to `__cxa_end_catch' /tmp/ccAZX80i.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status