Cannot open file 'python311_d.lib' - Python Help - Discussions on Python.org
Cannot open file 'python311_d.lib' Python Help c-api usersever (Bảo Nguyễn) August 27, 2023, 1:54pm 1 how can i fix this |---|---|---|---|---|---|---| |Error|LNK1104|cannot open file 'python311_d.lib'|Project|...Project\LINK|1|| this is my code: #include <Python.h> int main() { Py_Initialize(); PyRun_SimpleString("print(python trong c++)"); Py_Finalize(); } kanhaiya (kanhaiya) August 27, 2023, 2:22pm 2 [quote=“Bảo Nguyễn, post:1, topic:32399, username:usersever”] Py_Initialize(); coding usersever (Bảo Nguyễn) August 27, 2023, 2:42pm 3 what’s your mean MRAB (Matthew Barnett) August 27, 2023, 5:35pm 4 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. usersever (Bảo Nguyễn) August 28, 2023, 12:59am 5 how can i get License file to build this: my build log: 4>E:\download\Compressed\cpython-3.11.5\PCbuild\regen.targets(127,5): warning : License file E:\download\Compressed\cpython-3.11.5\externals\libffi-3.4.4\LICENSE is missing 4>E:\download\Compressed\cpython-3.11.5\PCbuild\regen.targets(127,5): warning : License file E:\download\Compressed\cpython-3.11.5\externals\openssl-bin-3.0.9\amd64\LICENSE is missing 4>E:\download\Compressed\cpython-3.11.5\PCbuild\regen.targets(127,5): warning : License file E:\download\Compressed\cpython-3.11.5\externals\tcltk-8.6.12.1\amd64\tcllicense.terms is missing 4>E:\download\Compressed\cpython-3.11.5\PCbuild\regen.targets(127,5): warning : License file E:\download\Compressed\cpython-3.11.5\externals\tcltk-8.6.12.1\amd64\tklicense.terms is missing 4>E:\download\Compressed\cpython-3.11.5\PCbuild\regen.targets(127,5): warning : License file E:\download\Compressed\cpython-3.11.5\externals\tcltk-8.6.12.1\amd64\tixlicense.terms is missing MRAB (Matthew Barnett) August 28, 2023, 1:03am 6 Those are warnings, not errors, so they shouldn’t affect building CPython. usersever (Bảo Nguyễn) August 28, 2023, 2:28am 7 oh, i found this error 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' MRAB (Matthew Barnett) August 28, 2023, 2:33am 8 The source for _ctypes is in <path to cpython>/Modules/_ctypes . usersever (Bảo Nguyễn) August 28, 2023, 2:37am 9 how can I fix this? alan0526 (Alan0526) February 2, 2024, 12:31am 10 just undef _DEBUG before include python.h for example: #ifdef _DEBUG #undef _DEBUG #include <Python.h> #define _DEBUG #else #include <Python.h> #endif