so 文件信息
# readelf -h libencrypt.so
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: DYN (Shared object file)
Machine: ARM
Version: 0x1
Entry point address: 0x0
Start of program headers: 52 (bytes into file)
Start of section headers: 16768 (bytes into file)
Flags: 0x5000000, Version5 EABI
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 7
Size of section headers: 40 (bytes)
Number of section headers: 21
Section header string table index: 20
python 及系统版本信息( docker 容器)
root@arm32v7-openjdk:/MyApp/pytest# python -V
Python 2.7.13
root@arm32v7-openjdk:/MyApp/pytest# uname -a
Linux arm32v7-openjdk 4.9.41-moby #1 SMP Wed Sep 6 00:05:16 UTC 2017 armv7l GNU/Linux
python 代码
import ctypes
ll = ctypes.cdll.LoadLibrary
"""
1 有试过绝对路径和把这个库文件 copy 到 /usr/local/lib/ 目录下
2 文件肯定存在
3 权限是 777
"""
lib = ll("./libencrypt.so")
报错信息
root@arm32v7-openjdk:/MyApp/pytest# python test.py
Traceback (most recent call last):
File "test.py", line 3, in <module>
lib = ll("./libencrypt.so")
File "/usr/lib/python2.7/ctypes/__init__.py", line 440, in LoadLibrary
return self._dlltype(name)
File "/usr/lib/python2.7/ctypes/__init__.py", line 362, in __init__
self._handle = _dlopen(self._name, mode)
OSError: ./libencrypt.so: cannot open shared object file: No such file or directory
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.