after changing the installation from 32 to 64Bit Ubuntu my code is python+ctypes+c99broken. I have so far read that the error ./libfoo.so: wrong ELF class: ELFCLASS32means that my libfoo.so[1] is a 32-bit library and that python wants a version with a 64-bit version. How to report gcc/ctypesto create a library as 32Bit?
Thanks for any feedback!
Error message:
File "foo.py", line 8, in <module>
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
[1] I compile libfoo.sowithgcc -c -std=c99 -lm -D_GNU_SOURCE -Wall -pedantic -fopenmp -ofoo.o foo.c
source
share