Re: "undefined symbol" in C extension module

2022-01-23 Thread Dan Stromberg
On Sun, Jan 23, 2022 at 9:02 AM Robert Latest via Python-list <
python-list@python.org> wrote:

> Dan Stromberg wrote:
> > Perhaps try:
> > https://stromberg.dnsalias.org/svn/find-sym/trunk
> >
> > It tries to find symbols in C libraries.
> >
> > In this case, I believe you'll find it in -lpythonx.ym
>
> Thanks! Found out that ldd produces many errors also with working python
> libraries. Turns out I tried to revive a package from v2.7. Need to adapt
> it to 3.x
>

I wonder if you're missing a -Wl,-rpath -Wl,/path/to/library/dir
?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: "undefined symbol" in C extension module

2022-01-23 Thread Dieter Maurer
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 (0x7ffe2454a000)
>   libc.so.6 => /usr/lib/libc.so.6 (0x7fb6b6eb9000)
>   /usr/lib64/ld-linux-x86-64.so.2 (0x7fb6b70a4000)
>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.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: "undefined symbol" in C extension module

2022-01-23 Thread Robert Latest via Python-list
Dan Stromberg wrote:
> Perhaps try:
> https://stromberg.dnsalias.org/svn/find-sym/trunk
>
> It tries to find symbols in C libraries.
>
> In this case, I believe you'll find it in -lpythonx.ym

Thanks! Found out that ldd produces many errors also with working python
libraries. Turns out I tried to revive a package from v2.7. Need to adapt
it to 3.x
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: "undefined symbol" in C extension module

2022-01-22 Thread Dan Stromberg
Perhaps try:
https://stromberg.dnsalias.org/svn/find-sym/trunk

It tries to find symbols in C libraries.

In this case, I believe you'll find it in -lpythonx.ym


On Sat, Jan 22, 2022 at 12:43 PM Robert Latest via Python-list <
python-list@python.org> wrote:

> 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 (0x7ffe2454a000)
> libc.so.6 => /usr/lib/libc.so.6 (0x7fb6b6eb9000)
> /usr/lib64/ld-linux-x86-64.so.2 (0x7fb6b70a4000)
> 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?
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


"undefined symbol" in C extension module

2022-01-22 Thread Robert Latest via Python-list
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 (0x7ffe2454a000)
libc.so.6 => /usr/lib/libc.so.6 (0x7fb6b6eb9000)
/usr/lib64/ld-linux-x86-64.so.2 (0x7fb6b70a4000)
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?
-- 
https://mail.python.org/mailman/listinfo/python-list