Closed gogagum closed 1 year ago
Just trying indicators for the first time, ran into same issue. codecvt_utf8 has been deprecated as of C++17. The solution is: "Users should use dedicated text-processing libraries instead." So, it appears the functionality needs to be incorporated into the library.
Another data point: this library doesn't compile on macOS 13 with Apple Clang 14. The reasons are the same; codecvt_utf8 has been removed from the standard library:
In file included from /Users/charles/src/indicators/samples/progress_bar_unicode.cpp:3:
In file included from /Users/charles/src/indicators/include/indicators/indeterminate_progress_bar.hpp:5:
In file included from /Users/charles/src/indicators/include/indicators/details/stream_helper.hpp:5:
/Users/charles/src/indicators/include/indicators/display_width.hpp:284:29: error: no member named 'codecvt_utf8' in namespace 'std'
std::wstring_convert<std::codecvt_utf8<wchar_t>> myconv;
~~~~~^
/Users/charles/src/indicators/include/indicators/display_width.hpp:284:49: error: expected '(' for function-style cast or type construction
std::wstring_convert<std::codecvt_utf8<wchar_t>> myconv;
~~~~~~~^
/Users/charles/src/indicators/include/indicators/display_width.hpp:284:50: error: expected unqualified-id
std::wstring_convert<std::codecvt_utf8<wchar_t>> myconv;
^
/Users/charles/src/indicators/include/indicators/display_width.hpp:285:10: error: use of undeclared identifier 'myconv'
return myconv.from_bytes(str);
^
/Users/charles/src/indicators/include/indicators/display_width.hpp:290:29: error: no member named 'codecvt_utf8' in namespace 'std'
std::wstring_convert<std::codecvt_utf8<wchar_t>> myconv;
~~~~~^
/Users/charles/src/indicators/include/indicators/display_width.hpp:290:49: error: expected '(' for function-style cast or type construction
std::wstring_convert<std::codecvt_utf8<wchar_t>> myconv;
~~~~~~~^
/Users/charles/src/indicators/include/indicators/display_width.hpp:290:50: error: expected unqualified-id
std::wstring_convert<std::codecvt_utf8<wchar_t>> myconv;
^
/Users/charles/src/indicators/include/indicators/display_width.hpp:291:10: error: use of undeclared identifier 'myconv'
return myconv.to_bytes(str);
Thanks for reporting this issue and thanks for your patience.
I've rewritten the function without codecvt
and merged a fix. If the fix does not work, please reopen this issue.
if you confirm that the fix works for you, I'll go ahead and prepare a new release.
@p-ranav I can confirm that building the samples using gcc (GCC) 12.2.1
from f03feac succeeds as opposed to f38bf22.
After using
indicators::ProgressBar
class in my code I recieve the following message fromgcc-12
compiler: