paullouisageneau / libdatachannel

C/C++ WebRTC network library featuring Data Channels, Media Transport, and WebSockets
https://libdatachannel.org/
Mozilla Public License 2.0
1.72k stars 350 forks source link

when cross compiling for arm,tests and examples failed. #1169

Open zlyadvocate opened 3 months ago

zlyadvocate commented 3 months ago

图片

[ 70%] Building CXX object CMakeFiles/datachannel.dir/src/impl/verifiedtlstransport.cpp.o [ 70%] Building CXX object CMakeFiles/datachannel.dir/src/impl/websocket.cpp.o [ 72%] Building CXX object CMakeFiles/datachannel.dir/src/impl/websocketserver.cpp.o [ 72%] Building CXX object CMakeFiles/datachannel.dir/src/impl/wstransport.cpp.o [ 72%] Building CXX object CMakeFiles/datachannel.dir/src/impl/wshandshake.cpp.o [ 74%] Linking CXX shared library libdatachannel.so [ 74%] Built target datachannel Scanning dependencies of target datachannel-benchmark [ 74%] Building CXX object CMakeFiles/datachannel-benchmark.dir/test/benchmark.cpp.o [ 74%] Linking CXX executable benchmark /opt/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.5.0/../../../../arm-linux-gnueabihf/bin/ld: warning: libssl.so.1.1, needed by libdatachannel.so.0.21.0, not found (try using -rpath or -rpath-link) /opt/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.5.0/../../../../arm-linux-gnueabihf/bin/ld: warning: libcrypto.so.1.1, needed by libdatachannel.so.0.21.0, not found (try using -rpath or -rpath-link) libdatachannel.so.0.21.0: undefined reference to SSL_CTX_use_certificate@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toEVP_CIPHER_CTX_ctrl@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to DTLS_method@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toPEM_read_bio_PrivateKey@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to SSL_set_tlsext_use_srtp@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toX509_set_issuer_name@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to BN_free@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toEVP_aes_192_ctr@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to SSL_set1_host@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toCRYPTO_get_ex_new_index@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to SSL_free@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toBN_to_ASN1_INTEGER@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to X509_digest@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toEVP_sha256@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to X509_gmtime_adj@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toERR_peek_last_error@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to BIO_meth_set_ctrl@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toBIO_s_mem@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to X509_NAME_new@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toERR_get_error@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to SSL_CTX_set_cipher_list@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toEC_KEY_set_asn1_flag@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to X509_sign@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toBIO_set_init@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to X509_set_version@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toSHA1_Init@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to EVP_Cipher@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toEVP_aes_128_gcm@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to ERR_error_string_n@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toOPENSSL_cleanse@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to BIO_free@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toSSL_CTX_set_verify_depth@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to SSL_ctrl@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toEC_KEY_free@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to HMAC_Init_ex@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toSSL_CTX_free@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to BN_rand@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toEVP_sha224@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to TLS_method@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toBIO_write@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to SSL_new@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toHMAC_Update@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to EVP_CipherInit_ex@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toSSL_export_keying_material@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to EVP_EncryptFinal_ex@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toSSL_set_connect_state@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to BIO_meth_set_create@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toX509_set_subject_name@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to SSL_get_ex_data@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toHMAC_CTX_new@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to BIO_meth_set_write@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toSSL_CTX_new@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to SSL_read@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toX509_NAME_free@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to EVP_aes_256_gcm@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toSSL_CTX_check_private_key@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to BN_new@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toX509_set_pubkey@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to EC_KEY_generate_key@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toX509_get_serialNumber@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to EVP_sha512@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toX509_free@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to EVP_sha384@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toSSL_CTX_load_verify_locations@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to BIO_meth_new@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toHMAC_CTX_free@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to EVP_PKEY_free@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toSSL_get_ex_data_X509_STORE_CTX_idx@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to SSL_set_verify_depth@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toOPENSSL_init_crypto@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to SHA1_Update@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toERR_clear_error@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to SSL_CTX_ctrl@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toSSL_set_accept_state@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to BIO_new@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toPEM_read_bio_X509@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to SSL_CTX_set_verify@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toBIO_get_data@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to X509_getm_notAfter@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toSSL_CTX_use_PrivateKey@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to EC_KEY_new_by_curve_name@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toSSL_CTX_set_default_verify_paths@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to EVP_EncryptInit_ex@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toSSL_set_hostflags@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to SSL_shutdown@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toSSL_alert_desc_string_long@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to RSA_new@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toEVP_EncryptUpdate@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to BIO_meth_set_destroy@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toEVP_aes_128_ctr@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to EVP_sha1@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toBIO_read@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to EVP_CIPHER_CTX_new@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toBIO_set_data@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to SSL_do_handshake@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toSSL_get_selected_srtp_profile@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to BIO_set_shutdown@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toEVP_aes_256_ctr@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to SSL_CTX_set_info_callback@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toHMAC_Final@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to SSL_CTX_set_options@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toOPENSSL_init_ssl@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to X509_getm_notBefore@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toBIO_ctrl@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to SSL_set_verify@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toEVP_CIPHER_CTX_free@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to X509_STORE_CTX_get_ex_data@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toEVP_CIPHER_CTX_reset@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to SSL_set_bio@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toSHA1_Final@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to SSL_CTX_set_quiet_shutdown@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toRSA_generate_key_ex@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to SSL_set_ex_data@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toX509_NAME_add_entry_by_NID@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to BN_set_word@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toEVP_PKEY_assign@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to X509_new@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toSSL_write@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to SSL_get_error@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toX509_STORE_CTX_get_current_cert@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference to EVP_PKEY_new@OPENSSL_1_1_0' libdatachannel.so.0.21.0: undefined reference toRSA_free@OPENSSL_1_1_0' collect2: error: ld returned 1 exit status

zlyadvocate commented 3 months ago

also,can't set libnice. Checking for module 'nice' No package 'nice' found Found LibNice: /home/zly/metartcthirdparty/lib/lib/libnice.so

zlyadvocate commented 3 months ago

add this before cmake-gui: export PKG_CONFIG_LIBDIR=/home/zly/metartcthirdparty/lib/lib/pkgconfig cmake can find nice.but benchmark ,tests,examples also failed to link .so. Checking for module 'nice' Found nice, version 0.1.22. Maybe should I change libdatachannel to make static library?How to change that?

zlyadvocate commented 3 months ago

copy related so to the build directory,fixed. 图片

Hope we can get a more smart way.

zlyadvocate commented 3 months ago

图片

paullouisageneau commented 3 months ago

The first issue is that the linker found libssl but not libcrypto is missing. It probably means your OpenSSL build is broken. Also, note that OpenSSL 1.1 is EOL and doesn't receive security fixes anymore, you should not use it and update to OpenSSL 3.

The following issues are because the .so files are not found. You shouldn't copy them around, instead you should install dynamic libraries, for instance under a /usr/local prefix. libnice is notoriously problematic due to its large number of dependencies, it's easier to use the library packaged with your system.

Creating a static library for libdatachannel itself can be done with the libdatachannel-static CMake target, but it is unrelated and won't solve any of those issues.