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.44k stars 284 forks source link

Unable to build on Linux (Ubuntu) #66

Closed mrityunjay-39k closed 2 years ago

mrityunjay-39k commented 2 years ago

Errors after running: $ ./unix.sh

/home/mrityunjay/CppServer/source/server/http/http_server.cpp: In lambda function:
/home/mrityunjay/CppServer/source/server/http/http_server.cpp:23:43: error: ‘constexpr fmt::v8::detail::udl_formatter<char> fmt::v8::literals::operator""_format(const char*, size_t)’ is deprecated [-Werror=deprecated-declarations]
   23 |         header.SetHeader("Cache-Control", "max-age={}"_format(timespan.seconds()));
      |                                           ^~~~~~~~~~~~~~~~~~~
In file included from /home/mrityunjay/CppServer/modules/CppCommon/include/string/format.h:21,
                 from /home/mrityunjay/CppServer/source/server/http/http_server.cpp:11:
/home/mrityunjay/CppServer/modules/CppCommon/modules/fmt/include/fmt/format.h:3059:31: note: declared here
 3059 | FMT_DEPRECATED constexpr auto operator"" _format(const char* s, size_t n)
      |                               ^~~~~~~~
/home/mrityunjay/CppServer/source/server/http/http_server.cpp:23:43: error: ‘constexpr fmt::v8::detail::udl_formatter<char> fmt::v8::literals::operator""_format(const char*, size_t)’ is deprecated [-Werror=deprecated-declarations]
   23 |         header.SetHeader("Cache-Control", "max-age={}"_format(timespan.seconds()));
      |                                           ^~~~~~~~~~~~~~~~~~~
In file included from /home/mrityunjay/CppServer/modules/CppCommon/include/string/format.h:21,
                 from /home/mrityunjay/CppServer/source/server/http/http_server.cpp:11:
/home/mrityunjay/CppServer/modules/CppCommon/modules/fmt/include/fmt/format.h:3059:31: note: declared here
 3059 | FMT_DEPRECATED constexpr auto operator"" _format(const char* s, size_t n)
      |                               ^~~~~~~~
[ 56%] Building CXX object CMakeFiles/cppserver.dir/source/server/http/https_session.cpp.o
[ 56%] Building CXX object CMakeFiles/cppserver.dir/source/server/ws/ws.cpp.o
[ 57%] Building CXX object CMakeFiles/cppserver.dir/source/server/ws/ws_client.cpp.o
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/cppserver.dir/build.make:300: CMakeFiles/cppserver.dir/source/server/http/http_server.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/mrityunjay/CppServer/source/server/http/https_server.cpp: In lambda function:
/home//mrityunjay/CppServer/source/server/http/https_server.cpp:23:43: error: ‘constexpr fmt::v8::detail::udl_formatter<char> fmt::v8::literals::operator""_format(const char*, size_t)’ is deprecated [-Werror=deprecated-declarations]
   23 |         header.SetHeader("Cache-Control", "max-age={}"_format(timespan.seconds()));
      |                                           ^~~~~~~~~~~~~~~~~~~
In file included from /home/mrityunjay/CppServer/modules/CppCommon/include/string/format.h:21,
                 from /home/mrityunjay/CppServer/source/server/http/https_server.cpp:11:
/home/mrityunjay/CppServer/modules/CppCommon/modules/fmt/include/fmt/format.h:3059:31: note: declared here
 3059 | FMT_DEPRECATED constexpr auto operator"" _format(const char* s, size_t n)
      |                               ^~~~~~~~
/home/mrityunjay/CppServer/source/server/http/https_server.cpp:23:43: error: ‘constexpr fmt::v8::detail::udl_formatter<char> fmt::v8::literals::operator""_format(const char*, size_t)’ is deprecated [-Werror=deprecated-declarations]
   23 |         header.SetHeader("Cache-Control", "max-age={}"_format(timespan.seconds()));
      |                                           ^~~~~~~~~~~~~~~~~~~
In file included from /home/mrityunjay/CppServer/modules/CppCommon/include/string/format.h:21,
                 from /home/mrityunjay/CppServer/source/server/http/https_server.cpp:11:
/home/mrityunjay/CppServer/modules/CppCommon/modules/fmt/include/fmt/format.h:3059:31: note: declared here
 3059 | FMT_DEPRECATED constexpr auto operator"" _format(const char* s, size_t n)
      |                               ^~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/cppserver.dir/build.make:342: CMakeFiles/cppserver.dir/source/server/http/https_server.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:261: CMakeFiles/cppserver.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

Environment:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian

gcc version: 9.3.0
mrityunjay-39k commented 2 years ago

Okay, got a workaround by commenting the line

include(SetCompilerWarnings)

in CppServer/CMakeLists.txt