How are you trying to compile and which error messages are you getting from the compiler? You do know that this are very important details
Anyway, to find out your gcc version, or any other rpm package:
rpm -qa | grep <name of what you are looking for>
some applications also show it's version by typing:
application_name -v or -version
You could alway try man application_name
for a fully detailed explanation of how to use the application in question...
Examples of compiling a cpp code with g++:
g++ -o executable hello.cpp
that's for c++ code. Many user try with gcc to compile c++ code:
gcc -o executable hello.cpp
That won't work. That first code will compile your code, link and create an executable (here smartly called "executable", but could be anything you want) which you can run with ./executable.
I hope it helps.
How to ask questions, the smart way
Posting and You...