python311_d.lib is from the debug version of CPython.
If you look in C:\Python311\libs (or wherever you installed Python) you’ll see python311.lib because it’s the release version of CPython.
If you need python311_d.lib, you’ll need to make a debug build of CPython from the source that’s on GitHub.
When I’m building extensions for CPython, I avoid that problem by making a release version instead, although I do disable optimisations while I’m working on it so that I can single-step through the code more easily.
4> File "E:\download\Compressed\cpython-3.11.5\PC\validate_ucrtbase.py", line 8, in <module>
4> from ctypes import (c_buffer, POINTER, byref, create_unicode_buffer,
4> File "E:\download\Compressed\cpython-3.11.5\Lib\ctypes\__init__.py", line 8, in <module>
4> from _ctypes import Union, Structure, Array
4>ModuleNotFoundError: No module named '_ctypes'