Skip to content

fix: linking error building _testcapi in Python 3.12 #434#435

Open
Andrej730 wants to merge 3 commits intopython-cmake-buildsystem:masterfrom
Andrej730:fix-linking-_testcapi
Open

fix: linking error building _testcapi in Python 3.12 #434#435
Andrej730 wants to merge 3 commits intopython-cmake-buildsystem:masterfrom
Andrej730:fix-linking-_testcapi

Conversation

@Andrej730
Copy link
Copy Markdown

@Andrej730 Andrej730 commented Dec 6, 2025

Resolves #434.

In 3.12 _testcapi now had a file with Py_LIMITED_API so it was requiring python3.lib to link.

https://github.com/python/cpython/blob/3.12/Modules/_testcapi/heaptype_relative.c

Though issue is resolved, it might be still worth investigating why CI didn't catched that error.

@jcfr

@Andrej730 Andrej730 force-pushed the fix-linking-_testcapi branch from 777576c to 31e8fa1 Compare December 6, 2025 16:47
@Andrej730
Copy link
Copy Markdown
Author

image

Error seems unrelated to the change. I've force pushed the branch with the same commit and now 3.9.22 failed, though previously 3.8.20 was failing.

@Andrej730 Andrej730 force-pushed the fix-linking-_testcapi branch from 31e8fa1 to 1f6a6a7 Compare April 8, 2026 20:35
@Andrej730
Copy link
Copy Markdown
Author

@jcfr can you please take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Linking error building with BUILD_LIBPYTHON_SHARED=ON - cannot open file 'python3.lib'

1 participant