I know that c++ code should be compiled and linked by g++, not gcc.
But why gcc can still compile c++ source code in spite of lots of c++ keywords in the source.
By the way, I found that I even can build a shared library by gcc with all c++ code. Why?
g++ is gcc, it just automatically links to the standard C++ libraries.
If your g++ code depends on the standard libraries (things in the
stdnamespace), you can-lstdc++)