"undefined symbol" in C extension module

Dieter Maurer dieter at handshake.de
Sun Jan 23 12:34:10 EST 2022


Robert Latest wrote at 2022-1-22 11:29 GMT:
>I've written some CPython extension modules in the past without problems. Now
>after moving to a new Archlinux box with Python3.10 installed, I can't build
>them any more. Or rather, I can build them but not use them due to "undefined
>symbols" during linking. Here's ldd's output when used on the "spam" example
>library from the docs:
>
>	linux-vdso.so.1 (0x00007ffe2454a000)
>	libc.so.6 => /usr/lib/libc.so.6 (0x00007fb6b6eb9000)
>	/usr/lib64/ld-linux-x86-64.so.2 (0x00007fb6b70a4000)
>undefined symbol: PyObject_Init	(./build/lib.linux-x86_64-3.10/
>    spam.cpython-310-x86_64-linux-gnu.so)

There are important C-API changes for Python 3.10 (and above).
You may need to modify your extensions such that they work with
recent Python versions.


More information about the Python-list mailing list