Please, always post the code you are trying to compile and the commands you are using to compile your program. If it's a c program, you've use this command:
gcc -o executable sample.c
If it's a c++ program, you will use this:
g++ -o executable sample.cpp
Basically, g++ will not compile c code and gcc will not compile c++ code. Also, there could be a problem with your code. You are most likely:
- Forgetting to use the line "using namespace std" or "std::cout" in your program.
Again, there could be a thousand of different reasons. Try posting always, a detailed things of what you are doing, how you doing and what error messages you got.
Good luck and have a nice day!