-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[BUG]: undefining _DEBUG breaks build on VS 2022 #3459
Comments
I think the primary reason is we can’t build numpy in debug mode(with the debug version msvcrt). ONNX and ONNX Runtime follow the same pattern. Either they all define the macro, or they all should undef it. |
related: #3403 |
Is this some limitation in MSVC or something in numpy is broken under debug build? From what I understand in other issue MSFT has 0 intention of supporting people undefining _DEBUG (and I agree with them, although I know very little about build hacks like this) |
You can always set |
Relevant issue: #1713 (comment) |
Not sure if I understand this. Tried to add (in cmakelists.txt):
but that didn't work. Can build pybind module in release, but unfortunately not in debug at present on VS2022. |
After that, the project compiles, but there are linker errors saying that
So, setting |
think this is fixed in #3497 |
Encountered the same problem on vs2019, I use vcpkg to install the latest python3.10 and pybind11 |
Not directly related, but I think it is still important to let all of you know that recently one of my colleagues found another issue:
Would it have impact to the both CRT copies or just one? It is a headache. I don't feel it is worth to continue thinking about these questions. |
Minor version update resolves known documented error (microsoft/onnxruntime#9735) which is a manifestation of a known pybind bug (pybind/pybind11#3459). Version selected based on comment on onnxruntime#9735 (microsoft/onnxruntime#9735 (comment))
Minor version update resolves known documented error (microsoft/onnxruntime#9735) which is a manifestation of a known pybind bug (pybind/pybind11#3459). Version selected based on comment on onnxruntime#9735 (microsoft/onnxruntime#9735 (comment))
Minor version update resolves known documented error (microsoft/onnxruntime#9735) which is a manifestation of a known pybind bug (pybind/pybind11#3459). Version selected based on comment on onnxruntime#9735 (microsoft/onnxruntime#9735 (comment))
Minor version update resolves known documented error (microsoft/onnxruntime#9735) which is a manifestation of a known pybind bug (pybind/pybind11#3459). Version selected based on comment on onnxruntime#9735 (microsoft/onnxruntime#9735 (comment))
Minor version update resolves known documented error (microsoft/onnxruntime#9735) which is a manifestation of a known pybind bug (pybind/pybind11#3459). Version selected based on comment on onnxruntime#9735 (microsoft/onnxruntime#9735 (comment))
Have this been fixed? I still encounter the error C2039: '_invalid_parameter': is not a member of '`global namespace'' when I compile with DEBUG flag. Compling with RELEASE is all good. My environment is Cmake 3.15 and MSVC14.29 (Cmake with vs2019) |
Required prerequisites
Problem description
After updating to VS2022 my build was broken, I originally reported it to Microsoft, but turns out it is probably pybind bug.
You are not allowed to undef _DEBUG macro.
https://github.com/pybind/pybind11/search?q=_DEBUG
Reproducible example code
The text was updated successfully, but these errors were encountered: