wtdcode / tun2socks

A blazing fast tun2socks implementation with pure C++ and boost.asio 🚀.
GNU General Public License v3.0
52 stars 12 forks source link

compile failed #6

Open ghost opened 2 years ago

ghost commented 2 years ago
Scanning dependencies of target fmt [ 0%] Building CXX object 3rd_party/fmt/CMakeFiles/fmt.dir/src/format.cc.o [ 1%] Building CXX object 3rd_party/fmt/CMakeFiles/fmt.dir/src/os.cc.o [ 2%] Linking CXX static library libfmt.a [ 2%] Built target fmt Scanning dependencies of target lwipcore [ 2%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/init.c.o [ 4%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/def.c.o [ 5%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/dns.c.o [ 6%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/inet_chksum.c.o [ 6%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/ip.c.o [ 8%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/mem.c.o [ 9%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/memp.c.o [ 10%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/netif.c.o [ 10%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/pbuf.c.o [ 12%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/raw.c.o [ 13%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/stats.c.o [ 13%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/sys.c.o [ 14%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/altcp.c.o [ 16%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/altcp_alloc.c.o [ 17%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/altcp_tcp.c.o [ 17%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/tcp.c.o [ 18%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/tcp_in.c.o [ 20%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/tcp_out.c.o [ 21%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/timeouts.c.o [ 21%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/udp.c.o [ 22%] Building CXX object lwip/CMakeFiles/lwipcore.dir/src/core/arch/sys_arch.cpp.o [ 24%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/ipv4/autoip.c.o [ 24%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/ipv4/dhcp.c.o [ 25%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/ipv4/etharp.c.o [ 27%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/ipv4/icmp.c.o [ 28%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/ipv4/igmp.c.o [ 28%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/ipv4/ip4_frag.c.o [ 29%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/ipv4/ip4.c.o [ 31%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/ipv4/ip4_addr.c.o [ 32%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/ipv6/dhcp6.c.o [ 32%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/ipv6/ethip6.c.o [ 33%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/ipv6/icmp6.c.o [ 35%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/ipv6/inet6.c.o [ 35%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/ipv6/ip6.c.o [ 36%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/ipv6/ip6_addr.c.o [ 37%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/ipv6/ip6_frag.c.o [ 39%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/ipv6/mld6.c.o [ 39%] Building C object lwip/CMakeFiles/lwipcore.dir/src/core/ipv6/nd6.c.o [ 40%] Building C object lwip/CMakeFiles/lwipcore.dir/src/api/api_lib.c.o [ 41%] Building C object lwip/CMakeFiles/lwipcore.dir/src/api/api_msg.c.o [ 41%] Building C object lwip/CMakeFiles/lwipcore.dir/src/api/err.c.o [ 43%] Building C object lwip/CMakeFiles/lwipcore.dir/src/api/if_api.c.o [ 44%] Building C object lwip/CMakeFiles/lwipcore.dir/src/api/netbuf.c.o [ 45%] Building C object lwip/CMakeFiles/lwipcore.dir/src/api/netdb.c.o [ 45%] Building C object lwip/CMakeFiles/lwipcore.dir/src/api/netifapi.c.o [ 47%] Building C object lwip/CMakeFiles/lwipcore.dir/src/api/sockets.c.o [ 48%] Building C object lwip/CMakeFiles/lwipcore.dir/src/api/tcpip.c.o [ 50%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ethernet.c.o [ 50%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/bridgeif.c.o [ 51%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/bridgeif_fdb.c.o [ 52%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/slipif.c.o [ 52%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/lowpan6_common.c.o [ 54%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/lowpan6.c.o [ 55%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/lowpan6_ble.c.o [ 56%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/zepif.c.o [ 56%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/auth.c.o [ 58%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/ccp.c.o [ 59%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/chap-md5.c.o [ 60%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/chap_ms.c.o [ 60%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/chap-new.c.o [ 62%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/demand.c.o [ 63%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/eap.c.o [ 63%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/ecp.c.o [ 64%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/eui64.c.o [ 66%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/fsm.c.o [ 67%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/ipcp.c.o [ 67%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/ipv6cp.c.o [ 68%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/lcp.c.o [ 70%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/magic.c.o [ 70%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/mppe.c.o [ 71%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/multilink.c.o [ 72%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/ppp.c.o [ 74%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/pppapi.c.o [ 74%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/pppcrypt.c.o [ 75%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/pppoe.c.o [ 77%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/pppol2tp.c.o [ 78%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/pppos.c.o [ 78%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/upap.c.o [ 79%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/utils.c.o [ 81%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/vj.c.o [ 81%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/polarssl/arc4.c.o [ 82%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/polarssl/des.c.o [ 83%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/polarssl/md4.c.o [ 85%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/polarssl/md5.c.o [ 85%] Building C object lwip/CMakeFiles/lwipcore.dir/src/netif/ppp/polarssl/sha1.c.o [ 86%] Linking CXX static library liblwipcore.a [ 86%] Built target lwipcore Scanning dependencies of target spdlog [ 87%] Building CXX object 3rd_party/spdlog/CMakeFiles/spdlog.dir/src/spdlog.cpp.o [ 89%] Building CXX object 3rd_party/spdlog/CMakeFiles/spdlog.dir/src/stdout_sinks.cpp.o [ 89%] Building CXX object 3rd_party/spdlog/CMakeFiles/spdlog.dir/src/color_sinks.cpp.o [ 90%] Building CXX object 3rd_party/spdlog/CMakeFiles/spdlog.dir/src/file_sinks.cpp.o [ 91%] Building CXX object 3rd_party/spdlog/CMakeFiles/spdlog.dir/src/async.cpp.o [ 91%] Linking CXX static library libspdlog.a [ 91%] Built target spdlog Scanning dependencies of target tun2socks [ 93%] Building CXX object CMakeFiles/tun2socks.dir/socks5/socks5_client.cpp.o /home/generic/tun2socks/socks5/socks5_client.cpp: In member function ‘bool toys::socks5::SOCKS5Client::connectServer(boost::asio::yield_context&)’: /home/generic/tun2socks/socks5/socks5_client.cpp:128:36: error: cannot convert ‘boost::system::error_code’ to ‘const boost::system::system_error&’ 128 make_error_code(TUN2SOCKSErrorCode::SOCKS5_WRONG_VERSION)); ~~~^~~~~~~~~~
boost::system::error_code
In file included from /home/generic/tun2socks/socks5/socks5_client.cpp:1: /home/generic/tun2socks/./socks5/socks5_client.h:75:60: note: initializing argument 1 of ‘void toys::socks5::SOCKS5Client::mayCallOnError(const boost::system::system_error&)’ 75 void mayCallOnError(const boost::system::system_error& err); ~~~~~~~^~~ /home/generic/tun2socks/socks5/socks5_client.cpp:132:49: error: cannot convert ‘boost::system::error_code’ to ‘const boost::system::system_error&’ 132 this->mayCallOnError(make_error_code( ~~~^
boost::system::error_code
133 TUN2SOCKSErrorCode::SOCKS5_AUTH_METHOD_NOT_SUPPORTED));
~~~~~~~~~~~~~
In file included from /home/generic/tun2socks/socks5/socks5_client.cpp:1: /home/generic/tun2socks/./socks5/socks5_client.h:75:60: note: initializing argument 1 of ‘void toys::socks5::SOCKS5Client::mayCallOnError(const boost::system::system_error&)’ 75 void mayCallOnError(const boost::system::system_error& err); ~~~~~~~^~~ /home/generic/tun2socks/socks5/socks5_client.cpp: In member function ‘bool toys::socks5::SOCKS5Client::connectDestination(boost::asio::yield_context&)’: /home/generic/tun2socks/socks5/socks5_client.cpp:163:36: error: cannot convert ‘boost::system::error_code’ to ‘const boost::system::system_error&’ 163 make_error_code(TUN2SOCKSErrorCode::SOCKS5_WRONG_VERSION)); ~~~^~~~~~~~~~
boost::system::error_code
In file included from /home/generic/tun2socks/socks5/socks5_client.cpp:1: /home/generic/tun2socks/./socks5/socks5_client.h:35:30: note: initializing argument 1 of ‘virtual void toys::socks5::SOCKS5Client::Delegate::OnError(const boost::system::system_error&)’ 35 virtual void OnError(const boost::system::system_error&) {} ^~~~~~~~~~ /home/generic/tun2socks/socks5/socks5_client.cpp:168:57: error: cannot convert ‘boost::system::error_code’ to ‘const boost::system::system_error&’ 168 this->delegate_->OnError(make_error_code( ~~~^
boost::system::error_code
169 TUN2SOCKSErrorCode::SOCKS5_CONNECT_COMMAND_FAILED));
~~~~~~~~~~
In file included from /home/generic/tun2socks/socks5/socks5_client.cpp:1: /home/generic/tun2socks/./socks5/socks5_client.h:35:30: note: initializing argument 1 of ‘virtual void toys::socks5::SOCKS5Client::Delegate::OnError(const boost::system::system_error&)’ 35 virtual void OnError(const boost::system::system_error&) {} ^~~~~~~~~~ /home/generic/tun2socks/socks5/socks5_client.cpp: In member function ‘bool toys::socks5::SOCKS5Client::authClient(boost::asio::yield_context&)’: /home/generic/tun2socks/socks5/socks5_client.cpp:219:65: error: cannot convert ‘boost::system::error_code’ to ‘const boost::system::system_error&’ 219 this->delegate_->OnError(make_error_code( ~~~^
boost::system::error_code
220 TUN2SOCKSErrorCode::
~~~~
221 SOCKS5_BAD_USERNAME_OR_PASSWORD));
~~~~~~~~
In file included from /home/generic/tun2socks/socks5/socks5_client.cpp:1: /home/generic/tun2socks/./socks5/socks5_client.h:35:30: note: initializing argument 1 of ‘virtual void toys::socks5::SOCKS5Client::Delegate::OnError(const boost::system::system_error&)’ 35 virtual void OnError(const boost::system::system_error&) {} ^~~~~~~~~~ /home/generic/tun2socks/socks5/socks5_client.cpp:238:65: error: cannot convert ‘boost::system::error_code’ to ‘const boost::system::system_error&’ 238 this->delegate_->OnError(make_error_code( ~~~^
boost::system::error_code
239 TUN2SOCKSErrorCode::
~~~~
240 SOCKS5_BAD_USR_PWD_AUTH_VERSION));
~~~~~~~~
In file included from /home/generic/tun2socks/socks5/socks5_client.cpp:1: /home/generic/tun2socks/./socks5/socks5_client.h:35:30: note: initializing argument 1 of ‘virtual void toys::socks5::SOCKS5Client::Delegate::OnError(const boost::system::system_error&)’ 35 virtual void OnError(const boost::system::system_error&) {} ^~~~~~~~~~ /home/generic/tun2socks/socks5/socks5_client.cpp:245:65: error: cannot convert ‘boost::system::error_code’ to ‘const boost::system::system_error&’ 245 this->delegate_->OnError(make_error_code( ~~~^
boost::system::error_code
246 TUN2SOCKSErrorCode::
~~~~
247 SOCKS5_BAD_USERNAME_OR_PASSWORD));
~~~~~~~~

In file included from /home/generic/tun2socks/socks5/socks5_client.cpp:1: /home/generic/tun2socks/./socks5/socks5_client.h:35:30: note: initializing argument 1 of ‘virtual void toys::socks5::SOCKS5Client::Delegate::OnError(const boost::system::system_error&)’ 35 | virtual void OnError(const boost::system::system_error&) {} | ^~~~~~~~~~ make[2]: [CMakeFiles/tun2socks.dir/build.make:63: CMakeFiles/tun2socks.dir/socks5/socks5_client.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:184: CMakeFiles/tun2socks.dir/all] Error 2 make: *** [Makefile:152: all] Error 2

jpollack commented 2 years ago

I see the same failure.

It looks like this is happening because of a dependency API change. tun2socks was written using Boost sometime at or after version 1.66.0. Right now, I'm using version 1.74 (3 years later) and the most current is 1.79 (2 years later). It's entirely possible (likely even) that between then and now the internals and semantics of how Boost deals with various errors has changed. :)

I might fix this myself, if necessary, though my strong inclination would be to remove all the Boost. :)

@butterfly1924: One thing you could do is make a clean build environment and try to build using older versions of the libraries, if you don't want to fix the code itself.