0

I'm trying to debug a Python extension that I wrote. In order to enable some memory debugging features I downloaded and built a Python version, which worked just fine. Now I'm trying to build my own package using that environment, but it fails due to the linker not finding the libpython.x.x.a static library.

building 'clusterline.cwsf.parser' extension
gcc -pthread -Wno-unused-result -Wsign-compare -g -Og -Wall -DPy_DEBUG -fPIC -I/usr/local/src/python/Python-3.6.8/Include -I/usr/local/src/python/Python-3.6.8 -c clusterline/cwsf/parser.c -o build/temp.linux-x86_64-3.6-pydebug/clusterline/cwsf/parser.o
gcc -pthread -shared build/temp.linux-x86_64-3.6-pydebug/clusterline/cwsf/parser.o -L. -lpython3.6d -o build/lib.linux-x86_64-3.6-pydebug/clusterline/cwsf/parser.cpython-36d-x86_64-linux-gnu.so
/usr/bin/ld: cannot find -lpython3.6d
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

Note that the library is present. What's missing is a "-L/usr/local/src/python/Python-3.6.8" linker flag. Why isn't it there, and how to get it there?

$ ls /usr/local/src/python/Python-3.6.8/*.a

Maybe I'm just spoilt by Python -- normally everything falls into place when calling /path/to/venv/bin/python, why doesn't that work in this case? I must be missing something essential.

1 Answer 1

0

Thou shalt not use ./configure --enable-shared and --with-pydebug at the same time.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.