Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
181 views
in Technique[技术] by (71.8m points)

python swig : ImportError wrong ELF class: ELFCLASS64

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...