Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Python 3.6.6 (default, Jun 27 2018, 14:44:17)
[GCC 8.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from cffi import FFI
>>> ffi = FFI()
>>> ffi.cdef("""
... char* crypt(const char*, const char*);
... """)
>>> C = ffi.dlopen(None)
>>> ffi.string(C.crypt("流れる".encode("sjis"), b"ab"))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/cffi/api.py", line 882, in __getattr__
make_accessor(name)
File "/usr/lib/python3/dist-packages/cffi/api.py", line 878, in make_accessor accessors[name](name)
File "/usr/lib/python3/dist-packages/cffi/api.py", line 808, in accessor_function
value = backendlib.load_function(BType, name)
AttributeError: function/symbol 'crypt' not found in library '<None>': python3: undefined symbol: crypt
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.