Reputation: 41
I have created a PyBind11 project on Visual Studio using CMake & VCPkg on Windows platform. I'm exposing C++ functionality in Python.
I have pybind11_x64-windows & python3.10_x64-windows installed via vcpkg and CMake3.24.1 installed through Visual Studio 2019 Professional separately.
I have the necessary CMakeLists.txt file in the project's root directory. The project builds correctly in Release mode, but in the Debug mode, I have linker error:
LINK : fatal error LNK1104: cannot open file 'python310.lib'
I don't understand, why Visual Studio needs python310.lib instead of python310_d.lib in the Debug mode. In VisualStudio, when I checked the Project->Property->Linker->Input->AdditionalDependencies, it correctly points to python310_d.lib.
I found this article on Google which seems relevant to some extent:
https://discourse.paraview.org/t/debug-build-fail-cannot-open-file-python310-lib/9000
but there doesn't seem to be a clear solution.
Is this a bug in VCPkg/CMake/Python or something else ? Does anyone have a solution to this ?
Upvotes: 2
Views: 469
Reputation: 1608
I was having the same problem with python311, and got puzzled by it. Thanks to the link you provided, I understood that it's because of autolinking, I am adding /NODEFAULTLIB: python313_d.lib
to supress the autolinking.
Upvotes: 0