# Build error in Windows in debug mode due to python312\_d.lib

**URL:** <https://discourse.slicer.org/t/build-error-in-windows-in-debug-mode-due-to-python312-d-lib/43781>\
**Category:** Development\
**Tags:** build\
**Created:** [July 20, 2025, 12:42pm UTC](https://discourse.slicer.org/t/build-error-in-windows-in-debug-mode-due-to-python312-d-lib/43781 "2025-07-20T12:42:27Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 20, 2025, 12:54pm UTC](https://discourse.slicer.org/t/build-error-in-windows-in-debug-mode-due-to-python312-d-lib/43781/2 "2025-07-20T12:54:53Z")

</div>

The only mentions of python312\_d.lib in any files in all build folders:

In `Python-3.12.10/PC/pyconfig.h`, `python-build/bin/Release/PC/pyconfig.h`, and `python-install\include\pyconfig.h`:

```auto
...
/* For an MSVC DLL, we can nominate the .lib files used by extensions */
#ifdef MS_COREDLL
# if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN)
                /* not building the core - must be an ext */
# if defined(_MSC_VER)
                        /* So MSVC users need not specify the .lib
                        file in their Makefile (other compilers are
                        generally taken care of by distutils.) */
# if defined(_DEBUG)
# pragma comment(lib,"python312_d.lib")
# elif defined(Py_LIMITED_API)
# pragma comment(lib,"python3.lib")
# else
# pragma comment(lib,"python312.lib")
# endif /* _DEBUG */
# endif /* _MSC_VER */
# endif /* Py_BUILD_CORE */
#endif /* MS_COREDLL */
...

```

In Slicer-build\Base\QTCore\qSlicerBaseQTCore.dir\Debug\qSlicerCoreApplication.obj:

```auto
/DEFAULTLIB:"python312_d.lib"

```

Modifying the pyconfig.h files from:

```
# pragma comment(lib,"python312_d.lib")

```

to

```
# pragma comment(lib,"python312.lib")

```

resolves the build problem, so something may have changed in how pyconfig.h is included or in `MS_COREDLL`, `Py_BUILD_CORE`, `Py_BUILD_CORE_BUILTIN`, `_MSC_VER`, or `_DEBUG` defines.

---

_[View the full topic](https://discourse.slicer.org/t/build-error-in-windows-in-debug-mode-due-to-python312-d-lib/43781)._
