-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
boost_python debug links to python3 release #5097
Comments
With boost 1.69 from |
Maybe there are cases where it is ok to link a release dll from a debug build as long as it has a pure C ABI. But we also link directly to the python lib as found by the cmake built in finder script. This is the debug version of the python lib for debug builds. Now this combination for sure wrecks havoc. So we definitely must be able to instruct boost to link against the debug python lib. |
I have the same problem. But I'm also struggling to understand how link.exe can depend on python36_d.lib when it is nowhere explicitly referenced. pyconfig.h properly imports pragma comment ( lib: python36.lib ) indirectly via include boost/python.h. There is one place in vcpkg.targets which adds "$(VcpkgRoot)debug\lib*.lib" to AdditionalDependencies, probably this make link.exe try all .libs and take the most appropriate one. Have command-line arguments higher precedence than source code pragma commen (lib) in link.exe? Does link.exe really work as expected here? Anyway, giving link.exe a help to find python36.lib solves the problem, and I set this in my local project. (I would expect AdditionalLibraryDirectories should be enough, since the source code reference python36.lib, but stating python36.lib again in AdditionalDependencies also required.) |
This might be the cause of issues that I'm seeing when attempting to link against boost-python for x64-windows-static, where the process silently exits with return code |
@perrog, yes, this is the root of the issue. if(VCPKG_TOOLCHAIN)
target_link_directories(${PROJECT_NAME} PRIVATE ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib;${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib)
endif() |
I also have the same problem. |
This issue should be fixed by https://github.com/microsoft/vcpkg/blob/master/ports/boost-python/b2-options.cmake. |
@PhoebeHui Have you defined BOOST_DEBUG_PYTHON before build? vcpkg/ports/boost-python/b2-options.cmake Lines 34 to 38 in 05c411d
|
@yurybura, thank you! I forget that, after I define BOOST_DEBUG_PYTHON, it links to python3 debug libs. |
I am stuck with the same problem. Where did you need to set it exactly? I tried in the CMakeLists of my project, and in the cached variables of the CMakePresets but neither of them worked. It still asks me for the Release libraries. I found this issue #23374 , and I understood that what I need is to modify boost compilation. Is that right? and how should I do it then? |
I am in the process of using some more libraries from vcpkg, namely python and boost. Release builds are mostly working, but when launching the debug build, the python environment is not properly initialized. I suspect that it is related to the fact that boost_python36-vc141-mt-gd-x64-1_68.dll (debug) has a dependency on python36.dll (release), and that I didn't find an option to specify "python-debugging=on" in the boost port.
Apparently this issue was fixed once in the past:
d88f53d
The text was updated successfully, but these errors were encountered: