title: Error "wrong ELF class" using ctypes
body: <p>after changing from a 32 to 64Bit Ubuntu installation my <code>python+ctypes+c99</code> code is broken. I read so far, that the error <code>./libfoo.so: wrong ELF class: ELFCLASS32</code> means, that my <code>libfoo.so</code>[1] is a 32Bit library and that python wants a 64Bit version. How do I tell <code>gcc/ctypes</code> to generate the library as 32Bit?</p>
  
  <p>Thanks for any feedback!</p>
  
  <p><strong>Error message:</strong></p>
  
  <pre><code> File "foo.py", line 8, in &lt;module&gt;
      autofoo=cdll.LoadLibrary("./libfoo.so")
    File "/usr/lib/python2.6/ctypes/__init__.py", line 431, in LoadLibrary
      return self._dlltype(name)
    File "/usr/lib/python2.6/ctypes/__init__.py", line 353, in __init__
      self._handle = _dlopen(self._name, mode)
  OSError: ./libfoo.so: wrong ELF class: ELFCLASS32
  </code></pre>
  
  <p>[1] I compile <code>libfoo.so</code> with <code>gcc -c  -std=c99 -lm -D_GNU_SOURCE -Wall -pedantic -fopenmp -ofoo.o foo.c</code></p>