Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Hello Friends, can anybody explain me what is the error in this procedure of compiling and executing a c++ program file. enter image description here compiling and executing

share|improve this question

1 Answer 1

If you haven't specified the name of the executable to produce with -o NAME, it will be called a.out, rather than the same name as the source file.

So either do:

g++ program.cpp -o program


g++ program.cpp
share|improve this answer
command for executing the a.out file? –  grv.giit Jan 4 '13 at 15:01
thanks this solved my issue!! –  grv.giit Jan 4 '13 at 15:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.