"undefined symbol" in C extension module

Robert Latest boblatest at yahoo.com
Sat Jan 22 06:29:08 EST 2022


Hi guys,

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)

[and more of the same]

It seems that I need to install some library to make this work, but which one?


More information about the Python-list mailing list