V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  cnbatch  ›  全部回复第 58 页 / 共 71 页
回复总数  1406
1 ... 54  55  56  57  58  59  60  61  62  63 ... 71  
2022-12-03 17:23:53 +08:00
回复了 cnbatch 创建的主题 C++ GNU 工具链编译出来的 libbotan-2.a 形同虚设,无法用于静态链接
@zoumouse 就以我给 Botan 提 issue 时的测试代码为例
https://github.com/randombit/botan/issues/3085

即使加了 -static ,还是一样报错。

@changnet 十分奇怪的是,我自己编译 Botan 源码自己链接,还是不行( Debian 11 和 Debian 最新测试版),但 alpine 用户可以。我按照 alpine 用户给出的经验操作去试,报错信息依然爆了一堆。

而同样都是 .a 静态编译,clang 工具链一下子就完成了,非常顺畅; VS 解决起来相对也是好一点,vcpkg 同样可以指定编译成动态库还是静态库,我是两种库都备好,这样就可以根据自己的设置选择正确的版本,选对了基本都能编译成功。

目前 clang 唯一不足的是对于 C++新标准的完善度相对较落后,其他方面我觉得比 GNU 好得多
2022-12-03 17:00:21 +08:00
回复了 cnbatch 创建的主题 C++ GNU 工具链编译出来的 libbotan-2.a 形同虚设,无法用于静态链接
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o): in function `Botan::secure_allocator<unsigned char>::allocate(unsigned long)':
share_defines.cpp:(.text._ZN5Botan16secure_allocatorIhE8allocateEm[_ZN5Botan16secure_allocatorIhE8allocateEm]+0x1d): undefined reference to `Botan::allocate_memory(unsigned long, unsigned long)'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o): in function `Botan::secure_allocator<unsigned long>::deallocate(unsigned long*, unsigned long)':
share_defines.cpp:(.text._ZN5Botan16secure_allocatorImE10deallocateEPmm[_ZN5Botan16secure_allocatorImE10deallocateEPmm]+0x28): undefined reference to `Botan::deallocate_memory(void*, unsigned long, unsigned long)'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o):(.data.rel.ro._ZTVN5Botan9SHA_3_384E[_ZTVN5Botan9SHA_3_384E]+0x28): undefined reference to `Botan::SHA_3::add_data(unsigned char const*, unsigned long)'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o):(.data.rel.ro._ZTVN5Botan9SHA_3_384E[_ZTVN5Botan9SHA_3_384E]+0x30): undefined reference to `Botan::SHA_3::final_result(unsigned char*)'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o):(.data.rel.ro._ZTVN5Botan9SHA_3_384E[_ZTVN5Botan9SHA_3_384E]+0x38): undefined reference to `Botan::SHA_3::clone() const'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o):(.data.rel.ro._ZTVN5Botan9SHA_3_384E[_ZTVN5Botan9SHA_3_384E]+0x40): undefined reference to `Botan::SHA_3::provider[abi:cxx11]() const'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o):(.data.rel.ro._ZTVN5Botan9SHA_3_384E[_ZTVN5Botan9SHA_3_384E]+0x48): undefined reference to `Botan::SHA_3::clear()'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o):(.data.rel.ro._ZTVN5Botan9SHA_3_384E[_ZTVN5Botan9SHA_3_384E]+0x50): undefined reference to `Botan::SHA_3::name[abi:cxx11]() const'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o):(.data.rel.ro._ZTVN5Botan9SHA_3_384E[_ZTVN5Botan9SHA_3_384E]+0x60): undefined reference to `Botan::SHA_3::copy_state() const'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o):(.data.rel.ro._ZTVN5Botan9SHA_3_256E[_ZTVN5Botan9SHA_3_256E]+0x28): undefined reference to `Botan::SHA_3::add_data(unsigned char const*, unsigned long)'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o):(.data.rel.ro._ZTVN5Botan9SHA_3_256E[_ZTVN5Botan9SHA_3_256E]+0x30): undefined reference to `Botan::SHA_3::final_result(unsigned char*)'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o):(.data.rel.ro._ZTVN5Botan9SHA_3_256E[_ZTVN5Botan9SHA_3_256E]+0x38): undefined reference to `Botan::SHA_3::clone() const'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o):(.data.rel.ro._ZTVN5Botan9SHA_3_256E[_ZTVN5Botan9SHA_3_256E]+0x40): undefined reference to `Botan::SHA_3::provider[abi:cxx11]() const'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o):(.data.rel.ro._ZTVN5Botan9SHA_3_256E[_ZTVN5Botan9SHA_3_256E]+0x48): undefined reference to `Botan::SHA_3::clear()'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o):(.data.rel.ro._ZTVN5Botan9SHA_3_256E[_ZTVN5Botan9SHA_3_256E]+0x50): undefined reference to `Botan::SHA_3::name[abi:cxx11]() const'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o):(.data.rel.ro._ZTVN5Botan9SHA_3_256E[_ZTVN5Botan9SHA_3_256E]+0x60): undefined reference to `Botan::SHA_3::copy_state() const'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o):(.data.rel.ro._ZTIN5Botan9SHA_3_384E[_ZTIN5Botan9SHA_3_384E]+0x10): undefined reference to `typeinfo for Botan::SHA_3'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o):(.data.rel.ro._ZTIN5Botan9SHA_3_256E[_ZTIN5Botan9SHA_3_256E]+0x10): undefined reference to `typeinfo for Botan::SHA_3'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/udphop.dir/build.make:100: udphop] Error 1
make[2]: Leaving directory '/home/USERNAME/udphop/build'
make[1]: *** [CMakeFiles/Makefile2:134: CMakeFiles/udphop.dir/all] Error 2
make[1]: Leaving directory '/home/USERNAME/udphop/build'
make: *** [Makefile:91: all] Error 2
2022-12-03 17:00:11 +08:00
回复了 cnbatch 创建的主题 C++ GNU 工具链编译出来的 libbotan-2.a 形同虚设,无法用于静态链接
[100%] Linking CXX executable udphop
/usr/bin/cmake -E cmake_link_script CMakeFiles/udphop.dir/link.txt --verbose=1
/usr/bin/c++ CMakeFiles/udphop.dir/src/main.cpp.o -o udphop -lstdc++ -lbotan-2 src/shares/libSHAREDEFINES.a src/networks/libNETCONNECTIONS.a src/shares/libSHAREDEFINES.a
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o): warning: relocation against `_ZTVN5Botan5SHA_3E' in read-only section `.text._ZN5Botan5SHA_3D2Ev[_ZN5Botan5SHA_3D5Ev]'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o): in function `Botan::SHA_3::~SHA_3()':
share_defines.cpp:(.text._ZN5Botan5SHA_3D2Ev[_ZN5Botan5SHA_3D5Ev]+0xf): undefined reference to `vtable for Botan::SHA_3'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o): in function `Botan::SHA_3_256::SHA_3_256()':
share_defines.cpp:(.text._ZN5Botan9SHA_3_256C2Ev[_ZN5Botan9SHA_3_256C5Ev]+0x19): undefined reference to `Botan::SHA_3::SHA_3(unsigned long)'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o): in function `Botan::SHA_3_384::SHA_3_384()':
share_defines.cpp:(.text._ZN5Botan9SHA_3_384C2Ev[_ZN5Botan9SHA_3_384C5Ev]+0x19): undefined reference to `Botan::SHA_3::SHA_3(unsigned long)'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o): in function `aes_256_gcm::set_key(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
share_defines.cpp:(.text._ZN11aes_256_gcm7set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN11aes_256_gcm7set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x1f0): undefined reference to `Botan::AEAD_Mode::create(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Botan::Cipher_Dir, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: share_defines.cpp:(.text._ZN11aes_256_gcm7set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN11aes_256_gcm7set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x2c6): undefined reference to `Botan::AEAD_Mode::create(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Botan::Cipher_Dir, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: share_defines.cpp:(.text._ZN11aes_256_gcm7set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN11aes_256_gcm7set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x372): undefined reference to `Botan::SymmetricAlgorithm::set_key(unsigned char const*, unsigned long)'
/usr/bin/ld: share_defines.cpp:(.text._ZN11aes_256_gcm7set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN11aes_256_gcm7set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x410): undefined reference to `Botan::SymmetricAlgorithm::set_key(unsigned char const*, unsigned long)'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o): in function `aes_256_ocb::set_key(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
share_defines.cpp:(.text._ZN11aes_256_ocb7set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN11aes_256_ocb7set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x342): undefined reference to `Botan::AEAD_Mode::create(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Botan::Cipher_Dir, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: share_defines.cpp:(.text._ZN11aes_256_ocb7set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN11aes_256_ocb7set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x418): undefined reference to `Botan::AEAD_Mode::create(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Botan::Cipher_Dir, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: share_defines.cpp:(.text._ZN11aes_256_ocb7set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN11aes_256_ocb7set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x4c4): undefined reference to `Botan::SymmetricAlgorithm::set_key(unsigned char const*, unsigned long)'
/usr/bin/ld: share_defines.cpp:(.text._ZN11aes_256_ocb7set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN11aes_256_ocb7set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x562): undefined reference to `Botan::SymmetricAlgorithm::set_key(unsigned char const*, unsigned long)'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o): in function `chacha20::set_key(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
share_defines.cpp:(.text._ZN8chacha207set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN8chacha207set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x2f6): undefined reference to `Botan::AEAD_Mode::create(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Botan::Cipher_Dir, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: share_defines.cpp:(.text._ZN8chacha207set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN8chacha207set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x3cc): undefined reference to `Botan::AEAD_Mode::create(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Botan::Cipher_Dir, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: share_defines.cpp:(.text._ZN8chacha207set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN8chacha207set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x478): undefined reference to `Botan::SymmetricAlgorithm::set_key(unsigned char const*, unsigned long)'
/usr/bin/ld: share_defines.cpp:(.text._ZN8chacha207set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN8chacha207set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x516): undefined reference to `Botan::SymmetricAlgorithm::set_key(unsigned char const*, unsigned long)'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o): in function `xchacha20::set_key(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
share_defines.cpp:(.text._ZN9xchacha207set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN9xchacha207set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x23c): undefined reference to `Botan::AEAD_Mode::create(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Botan::Cipher_Dir, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: share_defines.cpp:(.text._ZN9xchacha207set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN9xchacha207set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x312): undefined reference to `Botan::AEAD_Mode::create(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Botan::Cipher_Dir, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: share_defines.cpp:(.text._ZN9xchacha207set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN9xchacha207set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x3be): undefined reference to `Botan::SymmetricAlgorithm::set_key(unsigned char const*, unsigned long)'
/usr/bin/ld: share_defines.cpp:(.text._ZN9xchacha207set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN9xchacha207set_keyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x45c): undefined reference to `Botan::SymmetricAlgorithm::set_key(unsigned char const*, unsigned long)'
/usr/bin/ld: src/shares/libSHAREDEFINES.a(share_defines.cpp.o): in function `Botan::secure_allocator<unsigned char>::deallocate(unsigned char*, unsigned long)':
share_defines.cpp:(.text._ZN5Botan16secure_allocatorIhE10deallocateEPhm[_ZN5Botan16secure_allocatorIhE10deallocateEPhm]+0x28): undefined reference to `Botan::deallocate_memory(void*, unsigned long, unsigned long)'
2022-12-03 16:59:06 +08:00
回复了 cnbatch 创建的主题 C++ GNU 工具链编译出来的 libbotan-2.a 形同虚设,无法用于静态链接
@lixile 由于 Log 太长,这里删掉了
/usr/include/botan-2/botan/sha3.h:15:13: warning: this header will be made internal in the future
15 | BOTAN_FUTURE_INTERNAL_HEADER(sha3.h)
| ^~~~~~~~~~~~~~~~~~~~~~~~
这样的警告,其他的都保留

$ make VERBOSE=1
/usr/bin/cmake -S/home/USERNAME/udphop -B/home/USERNAME/udphop/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/USERNAME/udphop/build/CMakeFiles /home/USERNAME/udphop/build//CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/USERNAME/udphop/build'
make -f src/shares/CMakeFiles/SHAREDEFINES.dir/build.make src/shares/CMakeFiles/SHAREDEFINES.dir/depend
make[2]: Entering directory '/home/USERNAME/udphop/build'
cd /home/USERNAME/udphop/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/USERNAME/udphop /home/USERNAME/udphop/src/shares /home/USERNAME/udphop/build /home/USERNAME/udphop/build/src/shares /home/USERNAME/udphop/build/src/shares/CMakeFiles/SHAREDEFINES.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/USERNAME/udphop/build'
make -f src/shares/CMakeFiles/SHAREDEFINES.dir/build.make src/shares/CMakeFiles/SHAREDEFINES.dir/build
make[2]: Entering directory '/home/USERNAME/udphop/build'
[ 11%] Building CXX object src/shares/CMakeFiles/SHAREDEFINES.dir/share_defines.cpp.o
cd /home/USERNAME/udphop/build/src/shares && /usr/bin/c++ -I/usr/include/botan-2 -std=c++17 -MD -MT src/shares/CMakeFiles/SHAREDEFINES.dir/share_defines.cpp.o -MF CMakeFiles/SHAREDEFINES.dir/share_defines.cpp.o.d -o CMakeFiles/SHAREDEFINES.dir/share_defines.cpp.o -c /home/USERNAME/udphop/src/shares/share_defines.cpp
[ 22%] Linking CXX static library libSHAREDEFINES.a
cd /home/USERNAME/udphop/build/src/shares && /usr/bin/cmake -P CMakeFiles/SHAREDEFINES.dir/cmake_clean_target.cmake
cd /home/USERNAME/udphop/build/src/shares && /usr/bin/cmake -E cmake_link_script CMakeFiles/SHAREDEFINES.dir/link.txt --verbose=1
/usr/bin/ar qc libSHAREDEFINES.a CMakeFiles/SHAREDEFINES.dir/share_defines.cpp.o
/usr/bin/ranlib libSHAREDEFINES.a
make[2]: Leaving directory '/home/USERNAME/udphop/build'
[ 22%] Built target SHAREDEFINES
make -f src/networks/CMakeFiles/NETCONNECTIONS.dir/build.make src/networks/CMakeFiles/NETCONNECTIONS.dir/depend
make[2]: Entering directory '/home/USERNAME/udphop/build'
cd /home/USERNAME/udphop/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/USERNAME/udphop /home/USERNAME/udphop/src/networks /home/USERNAME/udphop/build /home/USERNAME/udphop/build/src/networks /home/USERNAME/udphop/build/src/networks/CMakeFiles/NETCONNECTIONS.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/USERNAME/udphop/build'
make -f src/networks/CMakeFiles/NETCONNECTIONS.dir/build.make src/networks/CMakeFiles/NETCONNECTIONS.dir/build
make[2]: Entering directory '/home/USERNAME/udphop/build'
[ 33%] Building CXX object src/networks/CMakeFiles/NETCONNECTIONS.dir/connections.cpp.o
cd /home/USERNAME/udphop/build/src/networks && /usr/bin/c++ -I/usr/include/botan-2 -std=c++17 -MD -MT src/networks/CMakeFiles/NETCONNECTIONS.dir/connections.cpp.o -MF CMakeFiles/NETCONNECTIONS.dir/connections.cpp.o.d -o CMakeFiles/NETCONNECTIONS.dir/connections.cpp.o -c /home/USERNAME/udphop/src/networks/connections.cpp
[ 44%] Building CXX object src/networks/CMakeFiles/NETCONNECTIONS.dir/client.cpp.o
cd /home/USERNAME/udphop/build/src/networks && /usr/bin/c++ -I/usr/include/botan-2 -std=c++17 -MD -MT src/networks/CMakeFiles/NETCONNECTIONS.dir/client.cpp.o -MF CMakeFiles/NETCONNECTIONS.dir/client.cpp.o.d -o CMakeFiles/NETCONNECTIONS.dir/client.cpp.o -c /home/USERNAME/udphop/src/networks/client.cpp
[ 55%] Building CXX object src/networks/CMakeFiles/NETCONNECTIONS.dir/server.cpp.o
cd /home/USERNAME/udphop/build/src/networks && /usr/bin/c++ -I/usr/include/botan-2 -std=c++17 -MD -MT src/networks/CMakeFiles/NETCONNECTIONS.dir/server.cpp.o -MF CMakeFiles/NETCONNECTIONS.dir/server.cpp.o.d -o CMakeFiles/NETCONNECTIONS.dir/server.cpp.o -c /home/USERNAME/udphop/src/networks/server.cpp
[ 66%] Building CXX object src/networks/CMakeFiles/NETCONNECTIONS.dir/stun.cpp.o
cd /home/USERNAME/udphop/build/src/networks && /usr/bin/c++ -I/usr/include/botan-2 -std=c++17 -MD -MT src/networks/CMakeFiles/NETCONNECTIONS.dir/stun.cpp.o -MF CMakeFiles/NETCONNECTIONS.dir/stun.cpp.o.d -o CMakeFiles/NETCONNECTIONS.dir/stun.cpp.o -c /home/USERNAME/udphop/src/networks/stun.cpp
[ 77%] Linking CXX static library libNETCONNECTIONS.a
cd /home/USERNAME/udphop/build/src/networks && /usr/bin/cmake -P CMakeFiles/NETCONNECTIONS.dir/cmake_clean_target.cmake
cd /home/USERNAME/udphop/build/src/networks && /usr/bin/cmake -E cmake_link_script CMakeFiles/NETCONNECTIONS.dir/link.txt --verbose=1
/usr/bin/ar qc libNETCONNECTIONS.a CMakeFiles/NETCONNECTIONS.dir/connections.cpp.o CMakeFiles/NETCONNECTIONS.dir/client.cpp.o CMakeFiles/NETCONNECTIONS.dir/server.cpp.o CMakeFiles/NETCONNECTIONS.dir/stun.cpp.o
/usr/bin/ranlib libNETCONNECTIONS.a
make[2]: Leaving directory '/home/USERNAME/udphop/build'
[ 77%] Built target NETCONNECTIONS
make -f CMakeFiles/udphop.dir/build.make CMakeFiles/udphop.dir/depend
make[2]: Entering directory '/home/USERNAME/udphop/build'
cd /home/USERNAME/udphop/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/USERNAME/udphop /home/USERNAME/udphop /home/USERNAME/udphop/build /home/USERNAME/udphop/build /home/USERNAME/udphop/build/CMakeFiles/udphop.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/USERNAME/udphop/build'
make -f CMakeFiles/udphop.dir/build.make CMakeFiles/udphop.dir/build
make[2]: Entering directory '/home/USERNAME/udphop/build'
[ 88%] Building CXX object CMakeFiles/udphop.dir/src/main.cpp.o
/usr/bin/c++ -I/usr/include/botan-2 -std=c++17 -MD -MT CMakeFiles/udphop.dir/src/main.cpp.o -MF CMakeFiles/udphop.dir/src/main.cpp.o.d -o CMakeFiles/udphop.dir/src/main.cpp.o -c /home/USERNAME/udphop/src/main.cpp
2022-12-03 00:45:24 +08:00
回复了 cnbatch 创建的主题 C++ GNU 工具链编译出来的 libbotan-2.a 形同虚设,无法用于静态链接
@zoumouse 作者是回避 libbotan.a 的链接问题,给出的命令可以运行成功,编译出来的程序是使用动态库的版本,等于没回答
2022-12-03 00:43:42 +08:00
回复了 cnbatch 创建的主题 C++ GNU 工具链编译出来的 libbotan-2.a 形同虚设,无法用于静态链接
@lixile 用当前工具链,自己编译出来的 libbotan.a 照样无法用于后续的静态链接,而且无论是 Linux 还是 NetBSD 都一样
@hsly109 针对最新 Debian 11 弄了个 2.17 的版本,应该够用的了。

原本我是打算全部以 static linking 的方式发布二进制的,奈何 Linux 版本的 Botan 只有动态库方式能用,静态库几乎反倒没法用。其他平台却可以正常用静态库。

我刚刚去看了下作者本人对开发环境的描述 ( https://botan.randombit.net/handbook/support.html ),Linux 是主力,然后是 Windows ,剩下的都靠 Github 自动化工具。既然 Linux 是作者的主力平台,使用起来却最“拉跨”,实在费解。
2022-12-01 18:04:22 +08:00
回复了 Zizpop 创建的主题 C++ 使用类型转换后为何打印同一个变量会出现两个不同的结果
对于未定义行为就没必要去纠结了,这种情况下编译器想怎么干都行,甚至直接让整个程序崩溃都不奇怪
2022-12-01 18:01:40 +08:00
回复了 Zizpop 创建的主题 C++ 使用类型转换后为何打印同一个变量会出现两个不同的结果
可以查阅 C++标准,1 楼给出的那段文字,位于 ISO IEC 14882 2020-12 的 PDF 的第 126 页。

国内有转载:
https://bbs.pediy.com/thread-267401-1.htm
@lly8666 保险起见,我还是再另外弄了个专门用于 botan 2.9 的版本,以防万一
2022-11-30 15:28:45 +08:00
回复了 fox0001 创建的主题 Windows [求教]安全的远程桌面方案?
用 VPN 连回去就可以了,如果因为需要安装客户端而不想用 Open VPN ,那就用 Windows 自带的那些,比如 PPTP 、L2TP ,都是 Windows 内置的

而且搭建 PPTP 和 L2TP 服务器端也不难,配置比 Open VPN 更加简便
@hsly109 好的,已经加了
@emma3 我个人觉得吧,国内的 QUIC 网站多起来再做会更好些,先看看各大网站能否倒逼运营商善待 UDP 流量
@aru 不提供 socks5 功能,也不打算支持。
实际上算下来相当于 NAT 打洞 + 自动转发 + 自动换端口。
毕竟我个人用的场景仅仅是为了辅助 NAT 打洞时的 VPN 回家。
@emma3 在 7 楼那里我就提到过是受到 v2ray 的启发,因为我就用这个功能用了很长时间。
好处是爬梯时减少端口被封的概率,也能减轻 UDP 限速的影响。
只不过 v2ray 的方案不太完美,必须指定固定的主端口,一旦主端口被 ban 那就无法通讯。主端口受到严重限速时也会影响更换端口时的稳定性。

影响最大的还是 NAT 打洞,墙内想要打洞互联的话,靠 v2ray 做底层传输就不适合了。
@lly8666 支持,每次更换端口时会自动扫一次。

如果数据一直传输不间断的话,它可以自动跟踪新的 IP ,所以理论上不用动态域名只填 IP 地址也能跟踪新 IP 的变化。
之所以这样做,主要是用于 STUN 给 NAT 打洞的场景,毕竟 NAT 打洞获得的新端口并不固定,这就必须自动跟踪了。
@XiaoxiaoPu
@swxk521
其实我是受到 v2ray 的启发,v2ray 很早就支持了 UDP 动态端口的功能,比起 hysteria 和 kcptun 还要早得多。
它们甚至有并行 session 的设置,多条 UDP session 一起来。
只不过它们并非单纯的简单转发,而是另有传输协议( v2ray 用的是 vmess + mkcp ,kcptun 顾名思义就是 kcp ,hysteria 用魔改版 QUIC ),效果自然不一样,它们都可以顺便对抗拥塞丢包。

当然了,多一个选择总没坏处,我就是打算单纯转发数据,因为部分场景不太需要对抗拥塞丢包(比如墙内跨运营商 VPN 回家)。
我个人的使用情况是,联通↔电信这样用的效果不错,这两家运营商互联基本上极少拥塞导致的丢包,倒是特别需要对付 UDP 限速。

一条 UDP Session 拆成多个,这也是个好办法,只要每一条 Session 的数据量不是太大的话,应该也不会被限速策略盯上
@unnamedhao 可以问问你楼下的这位资深 UDP 限速破解专家,他就是 udp2raw 的作者

@wangyucn 果然是资深 UDP 限速破解专家,平时几乎不出现,只要有人发帖的内容跟运营商的 UDP 限速相关就基本会出现😆
2022-11-20 21:07:37 +08:00
回复了 spr1ngs 创建的主题 Linux 公司要求写 Linux 故障一天一个,我只能想到几个
如果连 OpenSSH 都算的话,那就找一下 OpenSSH 的各种“故障”,然后把答案翻译成中文。
之所以加双引号,是因为其实很多“故障”其实不是故障,而只是没配置好而已。例如什么证书过期之类的,防火墙没打开相应端口,等等。
按照这个思路,可以把 Linux 的常见服务都列出来,然后去 serverfault superuser 进入 Linux 标签,把一些热门问题翻译成中文当成故障。
1 ... 54  55  56  57  58  59  60  61  62  63 ... 71  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5296 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 35ms · UTC 07:24 · PVG 15:24 · LAX 23:24 · JFK 02:24
Developed with CodeLauncher
♥ Do have faith in what you're doing.