Skip to content
Advertisement

Why does loading the libc shared library have “‘LibraryLoader’ object is not callable” error?

From https://en.wikipedia.org/wiki/Foreign_function_interface

the ctypes module can load C functions from shared libraries/DLLs on-the-fly and translate simple data types automatically between Python and C semantics as follows:

JavaScript

On Lubuntu 18.04

JavaScript

I was wondering why loading the libc shared library has “‘LibraryLoader’ object is not callable” error?

JavaScript

See also https://unix.stackexchange.com/questions/449107/what-differences-and-relations-are-between-the-various-libc-so

Advertisement

Answer

You’re confusing lower case cdll (which is a LibraryLoader) with upper case CDLL, which is the constructor for shared libraries.

This code will work as expected:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement