you want to "run" the .cpp file, or you want to "compile" it?
Assuming the more likely of the two, you want to compile it first. Use g++, which is the C++ compiler part of the GCC compiler collection. On Ubuntu, I have been told that g++ is not included by default, so you need to install it. If so, open a terminal window (called Gnome-Terminal in your menu system) and enter the following command:
Code:
sudo apt-get install build-essential
Now you should have g++ installed
**
To read the documentation for g++, type either:
or
To compile something (I usually use gcc (as in this example), not g++ but the syntax should be quite similar-- if you're the programmer, you'll figure it out
)):
Code:
gcc -o outputname -lSome-lib -lSome-other-lib source1.c source2.c
Now, if you actually have already compiled the code and have a binary, you can execute it from your terminal just by entering the path to it:
Code:
shell$ /path/to/my/binary
# or if it's in your current directory:
shell$ ./mybinary
** The stars above: I don't use Ubuntu, so I'm going from memory when I wrote that apt-get command for you to install g++. If that command doesn't work (because I've remembered it wrong), you can use your Synaptic package manager just as well, and locate g++ in there and install it.
Good luck! If this doesn't answer the question, or there's more to it, feel free to elaborate.