Refer to the GCC manual on Compiling C++ Programs:

As such, you did not need to explicitly link against the C++ standard library despite using <iosteam> and <cstring> because you compiled with g++...