Code:
knoppix@1[~]$ gcc -v test.cpp -o test
gcc is the compiler for C
g++ is the compiler for C++
test(name of program) is not a unique name because it conflicts with bash.
use this
g++ -v test.cpp -o test_1 (or what ever you like)