zhllxt / asio2

Header only c++ network library, based on asio,support tcp,udp,http,websocket,rpc,ssl,icmp,serial_port,socks5.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gcc7.2.0编译错误

chenyalyg opened this issue · comments

/home/chenya/code/dts/./thirdparty/asio2/include/asio2/external/magic_enum.hpp: In function 'constexpr std::size_t magic_enum::detail::find(std::string_view, char)':
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/external/magic_enum.hpp:237:29: error: call to non-constexpr function 'std::basic_string_view<_CharT, _Traits>::size_type std::basic_string_view<_CharT, _Traits>::find_first_of(_CharT, std::basic_string_view<_CharT, _Traits>::size_type) const [with _CharT = char; _Traits = std::char_traits; std::basic_string_view<_CharT, Traits>::size_type = unsigned int]'
return str.find_first_of(c);
~~~~~~~~~~~~~~~~~^~~
In file included from /home/chenya/code/dts/./thirdparty/asio2/include/asio2/base/server.hpp:33:0,
from /home/chenya/code/dts/./thirdparty/asio2/include/asio2/tcp/tcp_server.hpp:20,
from /home/chenya/code/dts/./thirdparty/asio2/include/asio2/http/ws_server.hpp:20,
from /home/chenya/code/dts/./thirdparty/asio2/include/asio2/websocket/ws_server.hpp:11,
from /home/chenya/code/dts/src/server/ws_sdk.h:11,
from /home/chenya/code/dts/src/main.cpp:3:
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/base/iopool.hpp: At global scope:
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/base/iopool.hpp:48:56: error: template argument 1 is invalid
std::declval<std::decay_t>()->io_context()), void>> : std::true_type {};
^

/home/chenya/code/dts/./thirdparty/asio2/include/asio2/base/iopool.hpp:48:66: error: template argument 2 is invalid
std::declval<std::decay_t>()->~io_context()), void>> : std::true_type {};
^~~~~~~~~
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/base/iopool.hpp:55:55: error: template argument 1 is invalid
std::declval<std::decay_t>().io_context()), void>> : std::true_type {};
^

/home/chenya/code/dts/./thirdparty/asio2/include/asio2/base/iopool.hpp:55:65: error: template argument 2 is invalid
std::declval<std::decay_t>().~io_context()), void>> : std::true_type {};
^~~~~~~~~
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/base/iopool.hpp:64:67: error: template argument 1 is invalid
(std::declval<std::decay_t>())->executor_work_guard()), void>> : std::true_type {};
^

/home/chenya/code/dts/./thirdparty/asio2/include/asio2/base/iopool.hpp:64:77: error: template argument 2 is invalid
(std::declval<std::decay_t>())->~executor_work_guard()), void>> : std::true_type {};
^~~~~~~~~
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/base/iopool.hpp:71:66: error: template argument 1 is invalid
(std::declval<std::decay_t>()).executor_work_guard()), void>> : std::true_type {};
^

/home/chenya/code/dts/./thirdparty/asio2/include/asio2/base/iopool.hpp:71:76: error: template argument 2 is invalid
(std::declval<std::decay_t>()).~executor_work_guard()), void>> : std::true_type {};
^~~~~~~~~
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/base/iopool.hpp:75:2: error: static assertion failed
static_assert(is_io_context_pointer<asio::io_context* >::value);
^~~~~~~~~~~~~
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/base/iopool.hpp:76:2: error: static assertion failed
static_assert(is_io_context_pointer<asio::io_context*& >::value);
^~~~~~~~~~~~~
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/base/iopool.hpp:77:2: error: static assertion failed
static_assert(is_io_context_pointerasio::io_context*&&::value);
^~~~~~~~~~~~~
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/base/iopool.hpp:78:2: error: static assertion failed
static_assert(is_io_context_pointer<std::shared_ptrasio::io_context >::value);
^~~~~~~~~~~~~
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/base/iopool.hpp:79:2: error: static assertion failed
static_assert(is_io_context_pointer<std::shared_ptrasio::io_context& >::value);
^~~~~~~~~~~~~
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/base/iopool.hpp:80:2: error: static assertion failed
static_assert(is_io_context_pointer<std::shared_ptrasio::io_context&&>::value);
^~~~~~~~~~~~~
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/base/iopool.hpp:81:2: error: static assertion failed
static_assert(is_io_context_pointer<std::shared_ptrasio::io_contextconst&>::value);
^~~~~~~~~~~~~
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/base/iopool.hpp:82:2: error: static assertion failed
static_assert(is_io_context_object<asio::io_context >::value);
^~~~~~~~~~~~~
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/base/iopool.hpp:83:2: error: static assertion failed
static_assert(is_io_context_object<asio::io_context& >::value);
^~~~~~~~~~~~~
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/base/iopool.hpp:84:2: error: static assertion failed
static_assert(is_io_context_objectasio::io_context&&::value);
^~~~~~~~~~~~~
In file included from /home/chenya/code/dts/./thirdparty/asio2/include/asio2/http/impl/ws_send_op.hpp:29:0,
from /home/chenya/code/dts/./thirdparty/asio2/include/asio2/http/ws_session.hpp:22,
from /home/chenya/code/dts/./thirdparty/asio2/include/asio2/http/ws_server.hpp:21,
from /home/chenya/code/dts/./thirdparty/asio2/include/asio2/websocket/ws_server.hpp:11,
from /home/chenya/code/dts/src/server/ws_sdk.h:11,
from /home/chenya/code/dts/src/main.cpp:3:
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/http/response.hpp:256:40: error: 'set_root_directory' declared as an 'inline' field
inline self& set_root_directory(std::filesystem::path path)
^~~~~~~~~~
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/http/response.hpp:256:16: error: expected ';' at end of member declaration
inline self& set_root_directory(std::filesystem::path path)
^~~~~~~~~~~~~~~~~~
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/http/response.hpp:256:40: error: 'std::filesystem' has not been declared
inline self& set_root_directory(std::filesystem::path path)
^~~~~~~~~~
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/http/response.hpp:256:57: error: expected ')' before 'path'
inline self& set_root_directory(std::filesystem::path path)
^~~~
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/http/response.hpp:265:21: error: 'filesystem' in namespace 'std' does not name a type
inline const std::filesystem::path& get_root_directory() noexcept
^~~~~~~~~~
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/http/response.hpp:347:31: error: 'fill_file' declared as an 'inline' field
inline self& fill_file(std::filesystem::path path,
^~~~~~~~~~
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/http/response.hpp:347:16: error: expected ';' at end of member declaration
inline self& fill_file(std::filesystem::path path,
^~~~~~~~~
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/http/response.hpp:347:31: error: 'std::filesystem' has not been declared
inline self& fill_file(std::filesystem::path path,
^~~~~~~~~~
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/http/response.hpp:347:48: error: expected ')' before 'path'
inline self& fill_file(std::filesystem::path path,
^~~~
/home/chenya/code/dts/./thirdparty/asio2/include/asio2/http/response.hpp:419:8: error: 'filesystem' in namespace 'std' does not name a type
std::filesystem::path root_directory
= std::filesystem::current_path();
^~~~~~~~~~

我在网上搜索了相关问题,filesystem 在gcc8.0以下版本位置在这里
#include<experimental/filesystem>

我目前使用v2.7版本并且替换filesystem 头文件解决这个问题,但还是想体验一下新版本 😑😑😑

gcc 8.2.0 以下未测过,有时间我测一下。