how to compiline c++ program from unix
g++ <filename> -o <outputFilename>
I hope this works because the command will depend on the compiler that is installed on your system.
Read the following links(as a result of quick google search) for details :
http://www.actcom.co.il/~choo/lupg/tutorials/c-on-unix/c-on-unix.html
http://www.cse.msu.edu/~cse231/HowToCompile.html