python swig : ImportError wrong ELF class: ELFCLASS64

。_饼干妹妹 提交于 2019-12-13 09:00:35

问题


I am trying to interface from python to c++ code via swig. I get the following error , while trying to execute my script.

File "./driver.py", line 4, in <module>
  from fixMessageSim import *
File "/var/user/pradyotd/testframework/fixMessageSim.py", line 12, in <module>
  import MessageFactory
File "/var/user/pradyotd/testframework/MessageFactory.py", line 25, in <module>
  _MessageFactory = swig_import_helper()
File "/var/user/pradyotd/testframework/MessageFactory.py", line 21, in swig_import_helper
  _mod = imp.load_module('_MessageFactory', fp, pathname, description)
ImportError: /var/user/pradyotd/testframework/_MessageFactory.so: wrong ELF class: ELFCLASS64`

when I run file on the .so I get

_MessageFactory.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, not stripped

similarly for python

/usr/bin/python: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

So I am not clear why a 64-bit .so would complain.

thanks


回答1:


It would appear, that the interpreter I thought I was using , was not the one in the file. This appears to be a non-issue.



来源:https://stackoverflow.com/questions/12184036/python-swig-importerror-wrong-elf-class-elfclass64

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!