Question: can gcc compile c++ code?
Answer: gcc can actually compile c++ code just fine. The errors you received are linker errors, not compiler errors. which makes it link to the standard c++ library, then it will work just fine.