Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

cpp program. But now I cannot run it. It show that command not found.

I compile it by;

gcc `pkg-config --cflags opencv` OpenCV_ViolaJones.cpp -o OpenCV_ViolaJones `pkg-config --libs opencv`

It's compiled successfully. However, when I run it:


It shows me "Command not found". I am pretty sure that I am in the same directory and use correct name.

Could you explain this to me, please? Thank you very much!

share|improve this question
Are you sure that it successfully compiled? You're trying to compile a C++ program (I assume, from the filename) with the C compiler. Please post the output of your gcc call. I'm willing to bet your compilation is failing, so the program you're attempting to run doesn't actually exist. – Kyle May 23 '13 at 19:56

You need to make it executable before being able to run it like that:

chmod +x OpenCV_ViolaJoanes

will make your compiled program executable and you will be then able to run it.

share|improve this answer
Thank you for your advice. Well, when I "ll" it, it show that -rw-------. After I use chmod, it does not change anything. I just want to know why and how. And even when I use "sudo", it show me that command not found. I am pretty sure that OpenCV works correctly, since I have run some of its examples, they works. – Fei May 24 '13 at 14:46

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.