Skip to content
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

Use of deprecated std::wstring_convert #4

Open
madebr opened this issue Sep 12, 2020 · 1 comment
Open

Use of deprecated std::wstring_convert #4

madebr opened this issue Sep 12, 2020 · 1 comment

Comments

@madebr
Copy link

madebr commented Sep 12, 2020

In 3fd/code/exceptions.cpp, std::wstring_convert is used, but that function is deprecated in c++17.

When building 3fd with MSVC2017.
Compiling fails with the following error:

C:\projects\3fd\core\exceptions.cpp(84): error C2664: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>> std::wstring_convert<std::codecvt_utf8<wchar_t,1114111,0>,wchar_t,std::allocator<wchar_t>,std::allocator<char>>::to_bytes(const _Elem *,const _Elem *)': cannot convert argument 1 from 'const TCHAR *' to '_Elem' [C:\projects\3fd\build_subfolder\core\3fd-core.vcxproj]
C:\projects\3fd\core\exceptions.cpp(84): note: There is no context in which this conversion is possible
C:\projects\3fd\core\exceptions.cpp(86): error C3536: 'text': cannot be used before it is initialized [C:\projects\3fd\build_subfolder\3fd\core\3fd-core.vcxproj]
C:\projects\3fd\core\exceptions.cpp(89): error C2440: 'return': cannot convert from 'int' to 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' [C:\projects\3fd\build_subfolder\core\3fd-core.vcxproj]

@faburaya
Copy link
Owner

Hi! Last time I checked, std::wstring_convert has been deprecated but without a proposed replacement in the STL. Which is why I continue to use it. I suggest that you disable the error raised by deprecation. This error is normally accompanied by a message that indicates a macro name, which can be defined in order to suppress this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants