Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] find_package can't find all the dependencies #15037

Closed
liwang54321 opened this issue Oct 31, 2023 · 21 comments
Closed

[bug] find_package can't find all the dependencies #15037

liwang54321 opened this issue Oct 31, 2023 · 21 comments
Assignees

Comments

@liwang54321
Copy link

Environment details

  • Operating System+version: ubuntu 22
  • Compiler+version: 11.2
  • Conan version: 2.0.13
  • Python version: 3.10.12

Steps to reproduce

In the config file, compile all libraries as dynamic libraries

[settings]
os=Linux
arch=armv8
compiler=gcc
compiler.cppstd=gnu17
compiler.version=11
compiler.libcxx=libstdc++11
build_type=Release

[options]
*:shared=True

build a conan package, for example ffmpeg/5.0, You can see that ffmpeg depends on x264

File: /home/lw/.conan2/p/b/ffmped7cdc6fda969b/p/lib/libavcodec.so.60.3.100

Dynamic section at offset 0xa736e8 contains 34 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libswresample.so.4]
 0x0000000000000001 (NEEDED)             Shared library: [libavutil.so.58]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libx264.so.164]
 0x0000000000000001 (NEEDED)             Shared library: [libx265.so.192]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000000e (SONAME)             Library soname: [libavcodec.so.60]

Using find_package in cmake depends on ffmpeg, but there is no libx264 library when link.

find_package(ffmpeg REQUIRED)

target_link_libraries(${PROJECT_NAME} PUBLIC 
    magic_enum::magic_enum 
    spdlog::spdlog_header_only
    zlmediakit::zlmediakit
    mpp::mpp 
    libsrtp::libsrtp 
    openssl::openssl 
    usrsctp::usrsctp
    ffmpeg::ffmpeg
    readerwriterqueue::readerwriterqueue
)

How to solve this issue, thanks

Logs

/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-g++ -O3 -DNDEBUG CMakeFiles/StreamServer.dir/application/main.cpp.o CMakeFiles/StreamServer.dir/application/sources/VideoCapture.cpp.o CMakeFiles/StreamServer.dir/application/sources/VideoEncoder.cpp.o CMakeFiles/StreamServer.dir/application/sources/StreamServer.cpp.o CMakeFiles/StreamServer.dir/application/sources/StreamSink.cpp.o -o StreamServer   -L/home/lw/.conan2/p/b/fmt4d76687e3ed16/p/lib  -L/home/lw/.conan2/p/b/zlmed2c9057539529b/p/lib  -L/home/lw/.conan2/p/b/libsrfade138bd1240/p/lib  -L/home/lw/.conan2/p/b/opens44f1dc79c108f/p/lib  -L/home/lw/.conan2/p/b/usrsc38dd4aaffa4c2/p/lib  -L/home/lw/.conan2/p/b/mpp20573945ccadf/p/lib  -L/home/lw/.conan2/p/b/ffmped7cdc6fda969b/p/lib  -L/home/lw/.conan2/p/b/libx2be607e4f6a3f6/p/lib  -L/home/lw/.conan2/p/b/libx2a34b793d4d073/p/lib  -Wl,-rpath,/home/lw/.conan2/p/b/fmt4d76687e3ed16/p/lib:/home/lw/.conan2/p/b/zlmed2c9057539529b/p/lib:/home/lw/.conan2/p/b/libsrfade138bd1240/p/lib:/home/lw/.conan2/p/b/opens44f1dc79c108f/p/lib:/home/lw/.conan2/p/b/usrsc38dd4aaffa4c2/p/lib:/home/lw/.conan2/p/b/mpp20573945ccadf/p/lib:/home/lw/.conan2/p/b/ffmped7cdc6fda969b/p/lib:/home/lw/.conan2/p/b/libx2be607e4f6a3f6/p/lib:/home/lw/.conan2/p/b/libx2a34b793d4d073/p/lib /home/lw/.conan2/p/b/fmt4d76687e3ed16/p/lib/libfmt.so /home/lw/.conan2/p/b/zlmed2c9057539529b/p/lib/libmk_api.so /home/lw/.conan2/p/b/mpp20573945ccadf/p/lib/librockchip_mpp.so /home/lw/.conan2/p/b/mpp20573945ccadf/p/lib/librockchip_vpu.so /home/lw/.conan2/p/b/ffmped7cdc6fda969b/p/lib/libavdevice.so /home/lw/.conan2/p/b/ffmped7cdc6fda969b/p/lib/libavfilter.so /home/lw/.conan2/p/b/ffmped7cdc6fda969b/p/lib/libavformat.so /home/lw/.conan2/p/b/ffmped7cdc6fda969b/p/lib/libavcodec.so -lrt -lstdc++ /home/lw/.conan2/p/b/ffmped7cdc6fda969b/p/lib/libswresample.so /home/lw/.conan2/p/b/ffmped7cdc6fda969b/p/lib/libswscale.so /home/lw/.conan2/p/b/ffmped7cdc6fda969b/p/lib/libavutil.so -ldl -lm -lpthread 
@liwang54321
Copy link
Author

When link,will reports an error the x264 dynamic library is missing.

/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: warning: libx264.so.164, needed by /home/lw/.conan2/p/b/ffmped7cdc6fda969b/p/lib/libavcodec.so, not found (try using -rpath or -rpath-link)
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: warning: libx265.so.192, needed by /home/lw/.conan2/p/b/ffmped7cdc6fda969b/p/lib/libavcodec.so, not found (try using -rpath or -rpath-link)

@memsharded
Copy link
Member

Hi @liwang54321

Thanks for your report.
The first step would be trying to isolate the issue. I think there could be different causes:

  • It could be an issue of the recipes, that they fail to do something correctly in the arm cross-building scenario. This can happen specially in open source third party libraries that can have complicated build systems.
  • There is some bug in Conan itself, not propagating correctly the information

In order to start understanding what could be failing, I'd recommend:

  • try to build the same build but with x86_64 architecture, native toolchain, and report
  • try to build the same build but without shared=True and report
  • try to do the same build but with x86_64 and without shared=True
  • Create a simple, small, reproducible example that shows there is a bug in Conan client tools (not recipes). With the conan new cmake_lib -d name=pkg -d version=0.1 -d requires=xxx is it possible to quickly create templates that can be conan create . to test things.

Another thing that could help a lot is providing a full CMakeLists.txt a full conanfile.txt and a minimal main.cpp, simplifying all other dependencies, leaving only ffmpeg. Something that we could reproduce fully on our end to investigate it. Thanks!

@liwang54321
Copy link
Author

liwang54321 commented Oct 31, 2023

Hi @memsharded
I tested according to your instructions and found that this problem is caused by *:shared when cross build, the static libraries and x86 not have this issue, The demo is as follows
toolchain download url : https://repo.jing.rocks/armbian-dl/_toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu.tar.xz
thank you support
main.c

#include <stdio.h>
#include <libavformat/avformat.h>

int main(int argc, char** argv)
{
    printf("%d\n", avformat_version());
    return 0;
}

CMakeLists.txt

cmake_minimum_required(VERSION 3.15.0)
project(StreamServer VERSION 0.1.0)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

find_package(ffmpeg REQUIRED)

add_executable(${PROJECT_NAME} main.c)

target_link_libraries(${PROJECT_NAME} PUBLIC 
    ffmpeg::ffmpeg
    ffmpeg::avformat
)

conan_profile_aarch64

[settings]
os=Linux
arch=armv8
compiler=gcc
compiler.cppstd=gnu17
compiler.version=11
compiler.libcxx=libstdc++11
build_type=Release

[options]
*:shared=True

[buildenv]
CC=/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc
CXX=/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-g++
AR=/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-ar
AS=/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-as
NM=/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-nm
OBJCOPY=/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-objcopy
OBJDUMP=/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-objdump
READELF=/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-readelf
RANLIB=/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-ranlib
STRIP=/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-strip

conan_profile_x86_64

[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux

[options]
*:shared=True

conanfile.py

from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout

class DeviceDevelopConan(ConanFile):
    name = "DeviceDevelop"
    version = "0.1.0"
    license = "GPL"
    author = "lw liwang54321@gmail.com"
    url = "www.github.com/device_develop"
    description = "device develop control soft"
    topics = ("jetson", "device")
    settings = "os", "compiler", "build_type", "arch"
    options = {"shared": [True, False], "fPIC": [True, False]}
    default_options = {"shared": True, "fPIC": True}
    generators = "CMakeDeps", "CMakeToolchain", "VirtualBuildEnv"

    def config_options(self):
        if self.settings.os == "Windows":
            del self.options.fPIC
    
    def configure(self):
        # For ffmpeg
        self.options['ffmpeg'].with_vaapi = False
        self.options['ffmpeg'].with_vdpau = False
        self.options['ffmpeg'].with_xcb = False
        self.options['ffmpeg'].with_pulse = False
        self.options['ffmpeg'].with_vulkan = False
        self.options['ffmpeg'].with_asm = False
        self.options['ffmpeg'].with_libalsa = False
        self.options['ffmpeg'].with_libfdk_aac = False
        self.options['ffmpeg'].with_libmp3lame = False
        self.options['ffmpeg'].with_opus = False
        self.options['ffmpeg'].with_vorbis = False
        self.options['ffmpeg'].postproc = False
        self.options['ffmpeg'].with_openjpeg = False
        self.options['ffmpeg'].with_openh264 = False
        self.options['ffmpeg'].with_libiconv = False
        self.options['ffmpeg'].with_zeromq = False
        self.options['ffmpeg'].with_libvpx = False
        self.options['ffmpeg'].with_zlib = False
        self.options['ffmpeg'].with_bzip2 = False
        self.options['ffmpeg'].with_lzma = False
        self.options['ffmpeg'].with_freetype = False
        self.options['ffmpeg'].with_libwebp = False

        # macos options
        # self.options['ffmpeg'].with_appkit = False
        # self.options['ffmpeg'].with_videotoolbox = False
        # self.options['ffmpeg'].with_avfoundation = False
        # self.options['ffmpeg'].with_coreimage = False
        # self.options['ffmpeg'].with_audiotoolbox = False


    def source(self):
        pass

    def requirements(self):
        self.requires("ffmpeg/6.0")

    def build(self):
        cmake = CMake(self)
        cmake.configure()
        cmake.build()

    def package(self):
        cmake = CMake(self)
        cmake.install()

    def package_info(self):
        self.env_info.PATH.append(os.path.join(self.package_folder, "bin"))

run.sh

#!/bin/bash

top_dir=$(cd $(dirname $0); pwd)

conan install . \
    -pr:b ${top_dir}/conan_profile_x86_64 \
    -pr:h ${top_dir}/conan_profile_aarch64 \
    -of ${top_dir}/build/ \
    -b missing

source ${top_dir}/build/conanbuild.sh
cmake -B ${top_dir}/build/ \
        -S ${top_dir} \
        -DCMAKE_TOOLCHAIN_FILE=${top_dir}/build/conan_toolchain.cmake \
        -DCMAKE_INSTALL_PREFIX=${top_dir}/install \
        -DCMAKE_BUILD_TYPE=Release

cmake --build ${top_dir}/build/

run logs:

lw@lw:~/Workspace/conan_bug$ bash run.sh 

======== Input profiles ========
Profile host:
[settings]
arch=armv8
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux
[options]
*:shared=True
[buildenv]
CC=/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc
CXX=/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-g++
AR=/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-ar
AS=/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-as
NM=/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-nm
OBJCOPY=/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-objcopy
OBJDUMP=/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-objdump
READELF=/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-readelf
RANLIB=/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-ranlib
STRIP=/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-strip

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux
[options]
*:shared=True


======== Computing dependency graph ========
Graph root
    conanfile.py (DeviceDevelop/0.1.0): /home/lw/Workspace/conan_bug/conanfile.py
Requirements
    ffmpeg/6.0#8f36484c635d0924617faaf35cd0b565 - Cache
    libx264/cci.20220602#54f8388aa01fce20e671bfca06464c4e - Cache
    libx265/3.4#60fd8f9d5a93fd2338a46a0664ddc768 - Cache
    openssl/1.1.1s#3eeebc156917046ee80533dbbb8f4671 - Cache
Build requirements
    meson/1.2.2#aace9dcc1db58fa42ecb5292f724092d - Cache
    ninja/1.11.1#77587f8c8318662ac8e5a7867eb4be21 - Cache
    pkgconf/2.0.3#f996677e96e61e6552d85e83756c328b - Cache
Resolved version ranges
    openssl/[>=1.1 <4]: openssl/1.1.1s

======== Computing necessary packages ========
Requirements
    ffmpeg/6.0#8f36484c635d0924617faaf35cd0b565:8e4df391b2807173bc59d0f4d807d05a7e78571f#2b355fe6fb66706c3b7c64e4cd803335 - Cache
    libx264/cci.20220602#54f8388aa01fce20e671bfca06464c4e:934569590fec79d20810f52646391008973c6118#28a9d329dd4e119273b8da02d05e8c29 - Cache
    libx265/3.4#60fd8f9d5a93fd2338a46a0664ddc768:ccf3385331077a615f02e0b3497877ea91d283dd#f39c8ac2a150bd63d6c1de9ce342cdab - Cache
    openssl/1.1.1s#3eeebc156917046ee80533dbbb8f4671:523035fd734df98817383c07fc6ab01f1e7005aa#5ca9a6fa4043c3c52dc0ffc215a8c0d1 - Cache
Build requirements
Skipped binaries
    meson/1.2.2, ninja/1.11.1, pkgconf/2.0.3

======== Installing packages ========
libx264/cci.20220602: Already installed! (1 of 4)
libx265/3.4: Already installed! (2 of 4)
openssl/1.1.1s: Already installed! (3 of 4)
ffmpeg/6.0: Already installed! (4 of 4)
WARN: deprecated: Usage of deprecated Conan 1.X features that will be removed in Conan 2.X:
WARN: deprecated:     'cpp_info.names' used in: openssl/1.1.1s, libx264/cci.20220602
WARN: deprecated:     'cpp_info.build_modules' used in: openssl/1.1.1s

======== Finalizing install (deploy, generators) ========
conanfile.py (DeviceDevelop/0.1.0): Writing generators to /home/lw/Workspace/conan_bug/build/
conanfile.py (DeviceDevelop/0.1.0): Generator 'CMakeDeps' calling 'generate()'
conanfile.py (DeviceDevelop/0.1.0): Generator 'VirtualBuildEnv' calling 'generate()'
conanfile.py (DeviceDevelop/0.1.0): Generator 'CMakeToolchain' calling 'generate()'
conanfile.py (DeviceDevelop/0.1.0): CMakeToolchain generated: conan_toolchain.cmake
conanfile.py (DeviceDevelop/0.1.0): Preset 'conan-release' added to CMakePresets.json. Invoke it manually using 'cmake --preset conan-release' if using CMake>=3.23
conanfile.py (DeviceDevelop/0.1.0): If your CMake version is not compatible with CMakePresets (<3.23) call cmake like: 'cmake <path> -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=/home/lw/Workspace/conan_bug/build/conan_toolchain.cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Release'
conanfile.py (DeviceDevelop/0.1.0): CMakeToolchain generated: CMakePresets.json
conanfile.py (DeviceDevelop/0.1.0): CMakeToolchain generated: ../CMakeUserPresets.json
conanfile.py (DeviceDevelop/0.1.0): Generating aggregated env files
conanfile.py (DeviceDevelop/0.1.0): Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
Install finished successfully
-- Using Conan toolchain: /home/lw/Workspace/conan_bug/build/conan_toolchain.cmake
-- Conan toolchain: Setting CMAKE_POSITION_INDEPENDENT_CODE=ON (options.fPIC)
-- Conan toolchain: C++ Standard 17 with extensions ON
-- Conan toolchain: Setting BUILD_SHARED_LIBS = ON
-- Conan: Component target declared 'ffmpeg::avutil'
-- Conan: Component target declared 'ffmpeg::swscale'
-- Conan: Component target declared 'ffmpeg::swresample'
-- Conan: Component target declared 'ffmpeg::avcodec'
-- Conan: Component target declared 'ffmpeg::avformat'
-- Conan: Component target declared 'ffmpeg::avfilter'
-- Conan: Component target declared 'ffmpeg::avdevice'
-- Conan: Target declared 'ffmpeg::ffmpeg'
-- Conan: Target declared 'libx264::libx264'
-- Conan: Target declared 'libx265::libx265'
-- Conan: Component target declared 'OpenSSL::Crypto'
-- Conan: Component target declared 'OpenSSL::SSL'
-- Conan: Target declared 'openssl::openssl'
-- Conan: Including build module from '/home/lw/.conan2/p/b/opensde5a66b349c40/p/lib/cmake/conan-official-openssl-variables.cmake'
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/lw/Workspace/conan_bug/build
[ 50%] Building C object CMakeFiles/StreamServer.dir/main.c.o
[100%] Linking C executable StreamServer
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: warning: libssl.so.1.1, needed by /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so, not found (try using -rpath or -rpath-link)
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: warning: libcrypto.so.1.1, needed by /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so, not found (try using -rpath or -rpath-link)
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: warning: libx264.so.164, needed by /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavcodec.so, not found (try using -rpath or -rpath-link)
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: warning: libx265.so.192, needed by /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavcodec.so, not found (try using -rpath or -rpath-link)
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `SSL_CTX_use_certificate_chain_file@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `ERR_get_error@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BN_copy@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BN_set_word@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BN_cmp@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `SSL_CTX_use_PrivateKey_file@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `SSL_write@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `TLS_server_method@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BN_sub_word@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `SSL_CTX_free@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavcodec.so: undefined reference to `x264_param_default'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `SSL_get_error@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavcodec.so: undefined reference to `x264_param_apply_profile'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BIO_meth_set_destroy@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavcodec.so: undefined reference to `x265_api_get_192'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavcodec.so: undefined reference to `x264_encoder_headers'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BN_free@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BN_new@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BIO_meth_set_write@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `SSL_accept@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `SSL_CTX_load_verify_locations@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavcodec.so: undefined reference to `x264_param_cleanup'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BIO_meth_set_puts@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavcodec.so: undefined reference to `x264_encoder_maximum_delayed_frames'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BIO_get_data@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `SSL_set_bio@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavcodec.so: undefined reference to `x264_encoder_encode'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BIO_meth_free@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BIO_new@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BN_rand@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BN_CTX_free@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `SSL_CTX_set_verify@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `SSL_shutdown@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavcodec.so: undefined reference to `x264_encoder_reconfig'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavcodec.so: undefined reference to `x264_param_apply_fastfirstpass'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BIO_set_flags@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BIO_meth_set_ctrl@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BIO_meth_set_create@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `ERR_error_string@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `SSL_ctrl@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `TLS_client_method@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BIO_set_data@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `SSL_read@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `SSL_CTX_new@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavcodec.so: undefined reference to `x264_encoder_delayed_frames'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavcodec.so: undefined reference to `x264_param_parse'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BN_value_one@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavcodec.so: undefined reference to `x264_levels'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BIO_meth_set_read@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BIO_clear_flags@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BIO_meth_new@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `SSL_CTX_set_options@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavcodec.so: undefined reference to `x264_picture_init'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavcodec.so: undefined reference to `x264_encoder_close'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BN_CTX_new@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `SSL_free@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavcodec.so: undefined reference to `x264_param_default_preset'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BN_bin2bn@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BIO_set_init@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BN_num_bits@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BN_mod_exp@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `RAND_bytes@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BN_hex2bn@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `BN_bn2bin@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavcodec.so: undefined reference to `x264_encoder_open_164'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `SSL_connect@OPENSSL_1_1_0'
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: /home/lw/.conan2/p/b/ffmpeec9cf0990c890/p/lib/libavformat.so: undefined reference to `SSL_new@OPENSSL_1_1_0'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/StreamServer.dir/build.make:104: StreamServer] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/StreamServer.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2

@memsharded
Copy link
Member

I am trying things. A couple of quick notes:

  • Adding layout(self) method calling cmake_layout(self) helps having things clean by default
  • The above can be very simplified with conan build . command, it is mostly equivalent to your conan install + source ... + cmake ..
  • The self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) is Conan 1.X legacy, doing nothing in 2.0 (I know it is not being used here, but just in case). buildenv_info should be used instead.

@memsharded
Copy link
Member

I am trying to build first with the static libraries, to test things with the cross-compile setup, but it fails while building libx264:

/home/conan/conanws/gcc-arm/bin/aarch64-none-linux-gnu-gcc -Wno-maybe-uninitialized -Wshadow -O3 -ffast-math  -fPIC -O3 -Wall -I. -I../src -fno-finite-math-only -std=gnu99 -D_GNU_SOURCE -fPIC -fomit-frame-pointer -fno-tree-vectorize -fvisibility=hidden   -c ../src/common/aarch64/predict-c.c -o common/aarch64/predict-c-10.o -DHIGH_BIT_DEPTH=1 -DBIT_DEPTH=10
/home/conan/conanws/gcc-arm/bin/aarch64-none-linux-gnu-as -I. -I../src -c -DSTACK_ALIGNMENT=16 -DPIC -o common/aarch64/bitstream-a-8.o ../src/common/aarch64/bitstream-a.S -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8
/home/conan/conanws/gcc-arm/bin/aarch64-none-linux-gnu-as: invalid option -- 'S'
make: *** [Makefile:306: common/aarch64/bitstream-a-8.o] Error 1
make: *** Waiting for unfinished jobs....

libx264/cci.20220602: ERROR:
Package '91d2be378c733362f8fa14aa24a07fb4a96ef452' build failed
libx264/cci.20220602: WARN: Build folder /home/conan/.conan2/p/b/libx2d65bea5f522cc/b/build-release

Any idea of what would be different? I am not sure why the assembler is complaining about such "S" option that is not passed. Did you manage to build it without issues, directly from the recipe from ConanCenter? Is it possible that I am missing something installed in my system?

@SpaceIm
Copy link
Contributor

SpaceIm commented Oct 31, 2023

When link,will reports an error the x264 dynamic library is missing.

/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: warning: libx264.so.164, needed by /home/lw/.conan2/p/b/ffmped7cdc6fda969b/p/lib/libavcodec.so, not found (try using -rpath or -rpath-link)
/home/lw/Workspace/StreamServer/toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: warning: libx265.so.192, needed by /home/lw/.conan2/p/b/ffmped7cdc6fda969b/p/lib/libavcodec.so, not found (try using -rpath or -rpath-link)

Seems to be the issue described in #13560, in which the root cause is that CMakeDeps lacks definition of IMPORTED_LINK_DEPENDENT_LIBRARIES property in imported CMake targets representing a shared lib depending "privately" on other shared libs (it's very important for gnu linker on Linux).

Here is a workaround, not very elegant but it works: https://github.com/conan-io/conan-center-index/blob/b48d7fa9a697dbbf386b9fe16123b6197ef3bcf6/recipes/openmvg/all/conanfile.py#L119-L122
If your build is not controlled by a conanfile, you can add VirtualRunEnv to your conan generators as a workaround, and call its script before running your CMake build.

@memsharded
Copy link
Member

But why it works then when building for x86_64? if the issue was this definition, shouldn't it fail for x86_64 too?

@SpaceIm
Copy link
Contributor

SpaceIm commented Nov 1, 2023

Yes it should, unless openssl, libx264 and libx265 for x86_64 are installed in system paths?

Also in conancenter this issue is very uncommon for native builds on Linux with all shared, I don't always understand why it succeeds.

@liwang54321
Copy link
Author

I am trying to build first with the static libraries, to test things with the cross-compile setup, but it fails while building libx264:

/home/conan/conanws/gcc-arm/bin/aarch64-none-linux-gnu-gcc -Wno-maybe-uninitialized -Wshadow -O3 -ffast-math  -fPIC -O3 -Wall -I. -I../src -fno-finite-math-only -std=gnu99 -D_GNU_SOURCE -fPIC -fomit-frame-pointer -fno-tree-vectorize -fvisibility=hidden   -c ../src/common/aarch64/predict-c.c -o common/aarch64/predict-c-10.o -DHIGH_BIT_DEPTH=1 -DBIT_DEPTH=10
/home/conan/conanws/gcc-arm/bin/aarch64-none-linux-gnu-as -I. -I../src -c -DSTACK_ALIGNMENT=16 -DPIC -o common/aarch64/bitstream-a-8.o ../src/common/aarch64/bitstream-a.S -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8
/home/conan/conanws/gcc-arm/bin/aarch64-none-linux-gnu-as: invalid option -- 'S'
make: *** [Makefile:306: common/aarch64/bitstream-a-8.o] Error 1
make: *** Waiting for unfinished jobs....

libx264/cci.20220602: ERROR:
Package '91d2be378c733362f8fa14aa24a07fb4a96ef452' build failed
libx264/cci.20220602: WARN: Build folder /home/conan/.conan2/p/b/libx2d65bea5f522cc/b/build-release

Any idea of what would be different? I am not sure why the assembler is complaining about such "S" option that is not passed. Did you manage to build it without issues, directly from the recipe from ConanCenter? Is it possible that I am missing something installed in my system?

Hi @memsharded
This issue can be fix by add '"--disable-asm": "",' in libx264 conanfile.py
Thank you

        extra_ldflags = []
        args = {
            "--bit-depth": self.options.bit_depth,
            "--disable-cli": "",
            "--disable-asm": "",
            "--sbindir": None,          # Not understood by configure
            "--oldincludedir": None     # Not understood by configure
        }

@liwang54321
Copy link
Author

Yes it should, unless openssl, libx264 and libx265 for x86_64 are installed in system paths?

Also in conancenter this issue is very uncommon for native builds on Linux with all shared, I don't always understand why it succeeds.

Hi @SpaceIm
I checked this x86 environment and libx264 packages not install

✔︎ ~ find /usr -name "libx264.a*"
✔︎ ~ find /usr -name "libx264.so*"
✔︎ ~ 

@SpaceIm
Copy link
Contributor

SpaceIm commented Nov 1, 2023

@liwang54321
Copy link
Author

And does it work if you add something like this in your conanfile https://github.com/conan-io/conan-center-index/blob/b48d7fa9a697dbbf386b9fe16123b6197ef3bcf6/recipes/openmvg/all/conanfile.py#L119-L122?

Hi @SpaceIm
I added this patch and recompiled, The conanfile generate report an error.

    default_options = {"shared": True, "fPIC": True}
    # generators = "CMakeDeps", "CMakeToolchain", "VirtualBuildEnv"

    def generate(self):
        deps = CMakeDeps(self)
        deps.generate()
        tc = CMakeToolchain(self)
        if self.settings.os == "Linux":
            # Workaround for: https://github.com/conan-io/conan/issues/13560
            libdirs_host = [l for dependency in self.dependencies.host.values() for l in dependency.cpp_info.aggregated_components().libdirs]
            tc.variables["CMAKE_BUILD_RPATH"] = ";".join(libdirs_host)
        tc.generate()

    def config_options(self):
        if self.settings.os == "Windows":
            del self.options.fPIC
======== Installing packages ========
libx264/cci.20220602: Already installed! (1 of 4)
libx265/3.4: Already installed! (2 of 4)
openssl/1.1.1s: Already installed! (3 of 4)
ffmpeg/6.0: Already installed! (4 of 4)
WARN: deprecated: Usage of deprecated Conan 1.X features that will be removed in Conan 2.X:
WARN: deprecated:     'cpp_info.names' used in: openssl/1.1.1s, libx264/cci.20220602
WARN: deprecated:     'cpp_info.build_modules' used in: openssl/1.1.1s

======== Finalizing install (deploy, generators) ========
conanfile.py (DeviceDevelop/0.1.0): Calling generate()
conanfile.py (DeviceDevelop/0.1.0): Generators folder: <bound method DeviceDevelopConan.generators_folder of conanfile.py (DeviceDevelop/0.1.0)>
ERROR: Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/conan/cli/cli.py", line 272, in main
    cli.run(args)
  File "/usr/local/lib/python3.10/dist-packages/conan/cli/cli.py", line 172, in run
    command.run(self._conan_api, args[0][1:])
  File "/usr/local/lib/python3.10/dist-packages/conan/cli/command.py", line 125, in run
    info = self._method(conan_api, parser, *args)
  File "/usr/local/lib/python3.10/dist-packages/conan/cli/commands/install.py", line 72, in install
    conan_api.install.install_consumer(deps_graph, args.generator, source_folder, output_folder,
  File "/usr/local/lib/python3.10/dist-packages/conan/api/subapi/install.py", line 70, in install_consumer
    write_generators(conanfile, app)
  File "/usr/local/lib/python3.10/dist-packages/conans/client/generators/__init__.py", line 107, in write_generators
    mkdir(new_gen_folder)
  File "/usr/local/lib/python3.10/dist-packages/conans/util/files.py", line 242, in mkdir
    if os.path.exists(path):
  File "/usr/lib/python3.10/genericpath.py", line 19, in exists
    os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not method

ERROR: stat: path should be string, bytes, os.PathLike or integer, not method
run.sh: line 11: /home/lw/Workspace/conan_bug/build/conanbuild.sh: No such file or directory
CMake Error at /usr/local/share/cmake-3.27/Modules/CMakeDetermineSystem.cmake:154 (message):
  Could not find toolchain file:
  /home/lw/Workspace/conan_bug/build/conan_toolchain.cmake
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)

@SpaceIm
Copy link
Contributor

SpaceIm commented Nov 2, 2023

This error seems unrelated.

@liwang54321
Copy link
Author

hi @memsharded
Do you have a way to fix the build failure when *:shared=True

@memsharded
Copy link
Member

Managed to finally build the static, thanks to the hints above.
I will try the shared now.

@memsharded
Copy link
Member

Managed to reproduce the linking error when shared:

[ 50%] Linking C executable StreamServer
/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/cmake/data/bin/cmake -E cmake_link_script CMakeFiles/StreamServer.dir/link.txt --verbose=1
/home/conan/conanws/gcc-arm/bin/aarch64-none-linux-gnu-gcc -O3 -DNDEBUG CMakeFiles/StreamServer.dir/main.c.o -o StreamServer   -L/home/conan/.conan2/p/b/ffmpec543be5056794/p/lib  -L/home/conan/.conan2/p/b/libx2d379ab2422306/p/lib  -L/home/conan/.conan2/p/b/libx24dbac2af0d203/p/lib  -L/home/conan/.conan2/p/b/opensb13e665a636e1/p/lib  -L/home/conan/.conan2/p/b/zlib6ae0c63c73e7f/p/lib  -Wl,-rpath,/home/conan/.conan2/p/b/ffmpec543be5056794/p/lib:/home/conan/.conan2/p/b/libx2d379ab2422306/p/lib:/home/conan/.conan2/p/b/libx24dbac2af0d203/p/lib:/home/conan/.conan2/p/b/opensb13e665a636e1/p/lib:/home/conan/.conan2/p/b/zlib6ae0c63c73e7f/p/lib /home/conan/.conan2/p/b/ffmpec543be5056794/p/lib/libavdevice.so /home/conan/.conan2/p/b/ffmpec543be5056794/p/lib/libavfilter.so /home/conan/.conan2/p/b/ffmpec543be5056794/p/lib/libavformat.so /home/conan/.conan2/p/b/ffmpec543be5056794/p/lib/libavcodec.so -lrt -lstdc++ /home/conan/.conan2/p/b/ffmpec543be5056794/p/lib/libswresample.so /home/conan/.conan2/p/b/ffmpec543be5056794/p/lib/libswscale.so /home/conan/.conan2/p/b/ffmpec543be5056794/p/lib/libavutil.so -lm -lpthread -ldl
/home/conan/conanws/gcc-arm/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: warning: libssl.so.3, needed by /home/conan/.conan2/p/b/ffmpec543be5056794/p/lib/libavformat.so, not found (try using -rpath or -rpath-link)
/home/conan/conanws/gcc-arm/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: warning: libcrypto.so.3, needed by /home/conan/.conan2/p/b/ffmpec543be5056794/p/lib/libavformat.so, not found (try using -rpath or -rpath-link)
/home/conan/conanws/gcc-arm/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: warning: libx264.so.164, needed by /home/conan/.conan2/p/b/ffmpec543be5056794/p/lib/libavcodec.so, not found (try using -rpath or -rpath-link)
/home/conan/conanws/gcc-arm/bin/../lib/gcc/aarch64-none-linux-gnu/11.2.1/../../../../aarch64-none-linux-gnu/bin/ld: warning: libx265.so.192, needed by /home/conan/.conan2/p/b/ffmpec543be5056794/p/lib/libavcodec.so, not found (try using -rpath or -rpath-link)

I have verified that the libraries are there and -Wl,-rpath, seems correct, so things look good from the Conan side, will keep investigating

@memsharded
Copy link
Member

Inspecting the libx264 binary:

conan@15dd36c8886e:~/conanws/kk$ objdump -f /home/conan/.conan2/p/b/libx2ddcae079fa016/p/lib/libx264.so.164

/home/conan/.conan2/p/b/libx2ddcae079fa016/p/lib/libx264.so.164:     file format elf64-little
architecture: UNKNOWN!, flags 0x00000150:
HAS_SYMS, DYNAMIC, D_PAGED
start address 0x0000000000004b00

Maybe the .so is being discarded by the linker because of the unknown architecture?

@memsharded
Copy link
Member

Found that in the final link command it is failing with the -rpath, but if I manually replace that -rpath with -rpath-link I managed to make it work.
This seems related to https://gitlab.kitware.com/cmake/cmake/-/issues/22953

@memsharded
Copy link
Member

I have managed to workaround it and make it work with:

    def generate(self):
        tc = CMakeToolchain(self)
        libs = []
        for req, dep in self.dependencies.host.items():
            libs.extend(dep.cpp_info.libdirs)
        tc.variables["CMAKE_EXE_LINKER_FLAGS_INIT"] = "-Wl,-rpath-link,"+":".join(libs) 
        tc.generate()

This explicitly adds the -rpath-link to the linker flags.
I am trying to find a way to have CMake natively define it, but I can't.

@SpaceIm
Copy link
Contributor

SpaceIm commented Nov 9, 2023

Well, it's similar to this workaround actually: #15037 (comment)

Did you try to hardcode an IMPORTED_LINK_DEPENDENT_LIBRARIES in CMakeDeps to see if it works? It's the real fix (well it should depend on shared / shared relationship).

@memsharded
Copy link
Member

This would be solved by the new "incubating feature", the new CMakeDeps generator in https://docs.conan.io/2/incubating.html

I am closing the ticket as addressed by this new generator, but please don't hesitate to re-open or create new tickets for any further question or issue you might have. Thanks for your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants