我正在尝试通过 swig 从 python 接口到 c++ 代码。我在尝试执行我的脚本时收到以下错误。
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`
当我在 .so 上运行文件时,我得到
_MessageFactory.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, not stripped
同样对于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
所以我不清楚为什么 64 位 .so 会抱怨。
谢谢