I type the following:
is the name of the file.
I got a long, complicated string that basically said it couldn't find the libraries.
When that didn't work, I tried the other method:
chmod 777 foo.cpp
Then, I recieved more of a specific error message, saying it couldn't find the libraries.
Java generally did the same thing.
Please note, that with Java, I was able to get an output, and even though I have the packages for input (TerminalIO), I could not get the compiler to recognize TerminalIO or any other package.