-
Notifications
You must be signed in to change notification settings - Fork 87
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
MSVC 2022: C++ library build broken with UNICODE #29
Comments
I was unable to reproduce this compilation issue with MSVC 2019 nor MSVC 2022 (installed it on purpose, only the "Build Tools"), when trying to build the test program. In ./c++/testprogram/CMakeList.txt, the In short, in my case, both the actual code and your patch are working, also both for MSVC 2019 or 2022. Can you give more details on your build setup and/or reproduce the issue with the provided test program (so with |
I'm currently away from home, but this Monday when I get back I'll build it and send you the outputs. |
I've had the same issue in VS2019 v16.8.3 alongside a slew of warnings (will dig those out and open a separate issue listing them / a PR fixing them). I'm using these flags: /W4 /WX /std:c++latest /permissive- /D WIN32_LEAN_AND_MEAN /D NOMINMAX Wonder if it's the permissive- (i.e. strict mode) flag. My local fix was
|
Running
It definitely seems to be caused by strict mode. Edit: I have not found any warning, though. So I don't know about them. |
Thanks, I was able to reproduce it with /W4 /permissive- indeed! |
When trying to build the c++ library while having UNICODE declared, the following error occurs:
Basically, in that line,
LogFile.LoggerName = KERNEL_LOGGER_NAME;
the structure field expects a non-const value, whileKERNEL_LOGGER_NAME
is const. I have worked around it by casting it to(LPWSTR)
. I don't know the API exactly, so it feels like a hack to cast it to non-constness.The text was updated successfully, but these errors were encountered: