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

I compile my c code with gcc and it creates an obj code but when I tried to run it it gives cannot execute binary file error how can I solve this problem can you help me?

gcc -c virtualAddressManager.c -o vam


cannot execute binary file
share|improve this question
up vote 2 down vote accepted

Why are you creating an object file? If you want to create an executable, you shouldn't use the -c option.

Additionally, where did you get the vam.exe from? With the command you issued, you will get an output file called vam without the .exe part. You aren't working on Windows, are you?

To get an executable and run it, you should do

gcc virtualAddressManager.c -o vam
chmod +x vam
share|improve this answer
you should not need chmod +x vam It won't hurt but gcc will make vam executable by default. – Warren Hill May 8 '13 at 20:04
No I am not working on Windows I have made a mistake here at vam.exe – Esat Bektaş May 8 '13 at 20:42
thanks a lot it works but core dumped :/ – Esat Bektaş May 8 '13 at 20:50

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.