Blue-Burst-Patch-Project 始终无法构建 - Visual Studio 2022 c++14/17

问题描述 投票:0回答:1

编辑:我试图联系存储库所有者,但他们没有帮助弄清楚为什么它无法构建

我无法在 Visual Studio 2022 中构建 Blue-Burst-Patch-Project

我尝试使用 c++17 标准构建它,编译器说

1>C:\Users\Lenka\Desktop\Blue-Burst-Patch-Project-master\Blue Burst Patch Project\common.cpp(84,38): error C4996: 'std::codecvt_utf8<wchar_t,1114111,(std::codecvt_mode)0>': warning STL4017: std::wbuffer_convert, std::wstring_convert, and the <codecvt> header (containing std::codecvt_mode, std::codecvt_utf8, std::codecvt_utf16, and std::codecvt_utf8_utf16) are deprecated in C++17. (The std::codecvt class template is NOT deprecated.) The C++ Standard doesn't provide equivalent non-deprecated functionality; consider using MultiByteToWideChar() and WideCharToMultiByte() from <Windows.h> instead. You can define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning. 1>D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\codecvt(35,1): message : see declaration of 'std::codecvt_utf8' 1>C:\Users\Lenka\Desktop\Blue-Burst-Patch-Project-master\Blue Burst Patch Project\common.cpp(84,17): error C4996: 'std::wstring_convert<std::codecvt_utf8<wchar_t,1114111,(std::codecvt_mode)0>,wchar_t,std::allocator<wchar_t>,std::allocator<char>>': warning STL4017: std::wbuffer_convert, std::wstring_convert, and the <codecvt> header (containing std::codecvt_mode, std::codecvt_utf8, std::codecvt_utf16, and std::codecvt_utf8_utf16) are deprecated in C++17. (The std::codecvt class template is NOT deprecated.) The C++ Standard doesn't provide equivalent non-deprecated functionality; consider using MultiByteToWideChar() and WideCharToMultiByte() from <Windows.h> instead. You can define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning. 1>D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\xlocbuf(304,1): message : see declaration of 'std::wstring_convert' 1>C:\Users\Lenka\Desktop\Blue-Burst-Patch-Project-master\Blue Burst Patch Project\common.cpp(84,62): error C4996: 'std::wstring_convert<std::codecvt_utf8<wchar_t,1114111,(std::codecvt_mode)0>,wchar_t,std::allocator<wchar_t>,std::allocator<char>>::from_bytes': warning STL4017: std::wbuffer_convert, std::wstring_convert, and the <codecvt> header (containing std::codecvt_mode, std::codecvt_utf8, std::codecvt_utf16, and std::codecvt_utf8_utf16) are deprecated in C++17. (The std::codecvt class template is NOT deprecated.) The C++ Standard doesn't provide equivalent non-deprecated functionality; consider using MultiByteToWideChar() and WideCharToMultiByte() from <Windows.h> instead. You can define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning.
然后我尝试用 c++ 14 标准构建它,它说

1>C:\Users\Lenka\Desktop\Blue-Burst-Patch-Project-master\Blue Burst Patch Project\hooking.h(37,17): error C2429: language feature 'init-statements in if/switch' requires compiler flag '/std:c++17' 1>C:\Users\Lenka\Desktop\Blue-Burst-Patch-Project-master\Blue Burst Patch Project\hooking.h(35,29): message : This diagnostic occurred in the compiler generated function 'void Hooking::Hook::CallHookCallbacks(void)'
在编译器输出的底部,它总是说

1>Done building project "Blue Burst Patch Project.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== ========== Build started at 6:05 PM and took 09.433 seconds ==========
还有其他人能够建造这个东西吗?

c++ c++17 c++14
1个回答
0
投票
正如错误消息所示,我添加了 #define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING 作为 common.cpp 的第一行,并且构建得很好。 – 退休忍者 6 分钟前

这有效!谢谢你的帮助

© www.soinside.com 2019 - 2024. All rights reserved.