Use
g++ test.cpp
instead, since this is c++ code.
Or, if you really want to use gcc
, add -lstdc++
to the command line, like so:
gcc test.cpp -lstdc++
Running md5
against the a.out
produced under each scenario shows that it's the same output.
But, yeah, g++
probably makes your world a simpler place.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…