That error can have a multitude of causes. The mere existence of the file does not necessarily mean the build will be successful.
Do you have it? If not, the build script may be falling back to the release version. Furthermore, the name of the debug link-time libraries may not end with _d. I’ve seen just d for example. The exact name depends on the build script (are you using nmake?).
Thanks for your message. Still not solved the issue and puzzled by it.
These are some facts and considerations:
I am compiling the project from within the Visual Studio IDE by manually selecting build. The Release configuration compiles OK, the Debug does not.
The release and debug Python libraries are in place and CMAKE should have pointed to them correctly, as otherwise the release compile should fail (below a picture of the contents of the libs subdir of the python interpreter
By looking at the properties of the WrappingPyhtonCore project in VisualStudio for the Debug configuration, it looks like that it is pointing to the right library path “C:\Python311\libs\python311_d.lib” and at the debug version of the library “python311_d.lib”
The link error though refers to a missing python311.lib
This is puzzling, as: 1) the project configuration is linking against the debug library python311_d.lib 2) in any case, the release library python311.lib is present in the same folder as the debug library, and so one of the two should be found.
I did not find any Debug build in the VTK dashboard. Has anyone tried building a Debug version of VTK 9.2.6 on Windows with wrapping for Python 3.11?
I you went through all that checklist and nothing solved it, you should make sure VS2022 is compatible with whatever version of VS was used to generate those .lib files. VS compilers are not always retro-compatible. Check this: C++ binary compatibility 2015-2022 | Microsoft Learn If VS2013, for example, was used to build Python, you will very likely have problems compiling with VS2022.
Thanks for the note: do I interpret it correctly that I should not expect VTK with Python bindings to Python 3.11 to compile correctly, for example for the debug version? I have looked at the dashboard and there seem not to be any debug version there. Has anyone at VTK tried compiling VTK with Python 3.11 bindings / debug under Windows?
I need to debug an external project. I will probably simply compile a Release With Debug info of the external project so it should link to the Release version of VTK. I should be all set with this, as I do not need to put breakpoints or follow the execution within VTK sources.