chronoxor / CppServer

Ultra fast and low latency asynchronous socket server & client C++ library with support TCP, SSL, UDP, HTTP, HTTPS, WebSocket protocols and 10K connections problem solution
MIT License
1.43k stars 284 forks source link

I am getting wstring_convert deprecated error. #96

Open xpd54 opened 7 months ago

xpd54 commented 7 months ago

I am compiling on macOS (14.4.1) and getting error in encoding.cpp. error: 'codecvt_utf8<wchar_t, 1114111, 0>' is deprecated [-Werror,-Wdeprecated-declarations] std::wstring_convert<std::codecvt_utf8> convert;

xpd54 commented 7 months ago

If someone is getting the same error. (if you find a way please leave comment here) At end I just ignored the deprecated error with GCC flag. Error was coming in modules/CppCommon/source/string/encoding.cpp

namespace CppCommon {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"

/*
Whole implementation of encoding.cpp
*/

#pragma GCC diagnostic pop
} // namespace CppCommon
nitko12 commented 6 months ago

I've just faced the same problem.

Thank you for the workaround :)

oxful commented 1 month ago

the problem still here...

/home/ec2-user/CppServer/modules/CppCommon/include/string/format.inl: In function ‘void CppCommon::print(fmt::v11::wformat_string<T ...>, T&& ...)’: /home/ec2-user/CppServer/modules/CppCommon/include/string/format.inl:32:24: error: expected primary-expression before ‘wchar_t’ 32 | return fmt::vprint(pattern, fmt::make_format_args(args...)); | ^~~ /home/ec2-user/CppServer/modules/CppCommon/include/string/format.inl:32:24: error: expected ‘;’ before ‘wchar_t’ 32 | return fmt::vprint(pattern, fmt::make_format_args(args...)); | ^~~ | ; /home/ec2-user/CppServer/modules/CppCommon/include/string/format.inl:32:31: error: expected unqualified-id before ‘>’ token

xpd54 commented 1 week ago

@oxful CppServer uses CppCommon module which has fmt dependency. 👇 sent a PR. https://github.com/chronoxor/CppCommon/pull/35