On performing a C++ compilation using g++, I get no errors, and my codes compile and execute cleanly. However, on using gcc - which I actually need to use,
This sounds odd.
I get a screenful of error messages, specifically these:
undefined reference to `std::cout'
You can use -lstdc++ on the link line.
Also, please don't send to both lists, just send to gcc-help.