Importing 32 bit swig library from python2.4 on 64 bit machine
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Importing 32 bit swig library from python2.4 on 64 bit machine
Hi,
I am using swig framework to invoke certain C APIs in a C Library from a python program. Unfortunately the python software needs to run on a 64 bit virtualization platform, whereas the C library is 32 bit (its a 3rd party library whose 64 bit version is not available). Lets say the name of the swig generated shared library is _my_swig.so. When the python wrapper makes "import _my_swig" call, i see the following error
ImportError: -snipsnip-/_my_swig.so: wrong ELF class: ELFCLASS32
which probably means I am trying to import a 32 bit library from 64 bit python. Can anybody suggest any workaround?
Hi Vikas, Thanks for your kind response. I think I didnt understand your comment. I already have a 64 bit python 2.4 running on my OS. My OS is centOS-5(x86_64) based and runs a hypervisor. Problem occurs because the 64 bit python is trying to import a 32 bit .so library - needed by swig framework. This results in "wrong ELF class: ELFCLASS32" error. If my library was 64 bit, this problem would not occur. But this 3rd party library doesnt have a 64 bit equivalent. Hence I am looking for suggestions on possible workarounds. Hope this makes sense.
Hi Vikas, Thanks for your kind response. I think I didnt understand your comment. I already have a 64 bit python 2.4 running on my OS. My OS is centOS-5(x86_64) based and runs a hypervisor. Problem occurs because the 64 bit python is trying to import a 32 bit .so library - needed by swig framework. This results in "wrong ELF class: ELFCLASS32" error. If my library was 64 bit, this problem would not occur. But this 3rd party library doesnt have a 64 bit equivalent. Hence I am looking for suggestions on possible workarounds. Hope this makes sense.
Regards
veerals123
Hi Veerals,
Please locate that ".so" file, run below commands on it and paste output here.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.