title: Can't run shared library compiled on Ubuntu on Mac
body: <p>I compiled a cpp file on the ubuntu machine and generated the linker using the following commands: </p>
  
  <pre><code>g++ -c -fPIC foo.cpp -o foo.o
  g++ -shared -Wl,-soname,libfoo.so -o libfoo.so  foo.o
  </code></pre>
  
  <p>Then I loaded the libfoo.so linker file in python like below.</p>
  
  <pre><code>from ctypes import *
  lib = cdll.LoadLibrary('./lib/cppFunctions/libfoo.so')
  </code></pre>
  
  <p>Then I can use the functions inside the cpp file with python on the ubuntu.</p>
  
  <p>however, when I try to load .so file (libfoo.so) it on my mac, I 
  get the following error.</p>
  
  <pre><code>OSError: dlopen(./lib/cppFunctions/libfoo.so, 6): no suitable image found.  Did find:
      ./lib/cppFunctions/libfoo.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00
  </code></pre>
  
  <p>Full Error:</p>
  
  <pre><code>File "Resume.py", line 7, in &lt;module&gt;
      from PhraseRecommender import *
    File "/Users/aerin/Documents/bitbucket_BYOR/PhraseRecommender.py", line 4, in &lt;module&gt;
      from SingleSentenceRecord import * #TODO: What is the right way to import.
    File "/Users/aerin/Documents/bitbucket_BYOR/SingleSentenceRecord.py", line 4, in &lt;module&gt;
      from ByorFunctions import *
    File "/Users/aerin/Documents/bitbucket_BYOR/ByorFunctions.py", line 29, in &lt;module&gt;
      lib = cdll.LoadLibrary('./lib/cppFunctions/libfoo.so')
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 443, in LoadLibrary
      return self._dlltype(name)
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 365, in __init__
      self._handle = _dlopen(self._name, mode)
  OSError: dlopen(./lib/cppFunctions/libfoo.so, 6): no suitable image found.  Did find:
      ./lib/cppFunctions/libfoo.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00
  </code></pre>
  
  <p>How can I make .so file run on mac?</p>