[issue42580] ctypes.util.find_library("libc") fails

Vadym Stupakov report at bugs.python.org
Tue Feb 16 09:04:28 EST 2021


Vadym Stupakov <vadim.stupakov at gmail.com> added the comment:

I mean, find_library relies on gcc linker, when you pass library name to the linker, it automatically ads "lib" prefix to the library
so, when you pass "libc", linker ads "lib" so u have an error with "liblibc" name.

just man ld and see "-l" option:

"
-l namespec
       --library=namespec
           Add the archive or object file specified by namespec to the
           list of files to link.  This option may be used any number of
           times.  If namespec is of the form :filename, ld will search
           the library path for a file called filename, otherwise it
           will search the library path for a file called libnamespec.a.
"

as you can see, you pass not a library name, but a "namespec"
which then transforms to "libnamespec"

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42580>
_______________________________________


More information about the Python-bugs-list mailing list