You can resolve this in several ways:
- Use
g++
in stead ofgcc
:g++ -g -o MatSim MatSim.cpp
- Add
-lstdc++
:gcc -g -o MatSim MatSim.cpp -lstdc++
- Replace
<string.h>
by<string>
This is a linker problem, not a compiler issue. The same problem is covered in the question iostream linker error – it explains what is going on.