title: mac osx yosemite gcc cannot execute binary file , command not found
body: <p>This article : <a href="https://superuser.com/questions/724301/how-to-solve-bash-cannot-execute-binary-file">https://superuser.com/questions/724301/how-to-solve-bash-cannot-execute-binary-file</a> can not help me to solve my problem.</p>
  
  <p>The step is below:</p>
  
  <pre><code>gcc -c hello.c -o hello.o
  </code></pre>
  
  <p>when I enter command :</p>
  
  <pre><code>./hello.o
  </code></pre>
  
  <p>the message is :</p>
  
  <p><strong>./hello.o: command not found</strong></p>
  
  <p>I try this:</p>
  
  <pre><code>chmod 755 ./hello.o
  </code></pre>
  
  <p>execute again, the message is :</p>
  
  <p><strong>-bash: ./hello.o: cannot execute binary file</strong></p>
  
  <p>I have checked the file version, it is <strong>Mach-O</strong> format for binaries.</p>
  
  <p>I enter this command:</p>
  
  <pre><code>file ./hello.o
  </code></pre>
  
  <p>it shows:</p>
  
  <p><strong>./hello.o: Mach-0 64-bit object x86_64</strong></p>
  
  <p>How can I solve this problem?</p>