Skip to content

build failure while linking llm_depth_anything with undefined references opencv calls #23

@parasseri

Description

@parasseri

Linking build/llm_depth_anything-1.6/llm_depth_anything-1.6
/opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/10.3.1/../../../../aarch64-none-linux-gnu/bin/ld: build/llm_depth_anything-1.6/libllm_depth_anything-1.6.a(main.cpp.o): in function common::get_input_data_no_letterbox(cv::Mat const&, std::vector<unsigned char, std::allocator<unsigned char> >&, int, int, bool)': main.cpp:(.text+0x770): undefined reference to cv::Mat::Mat(int, int, int, void*, unsigned long)'
/opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/10.3.1/../../../../aarch64-none-linux-gnu/bin/ld: main.cpp:(.text+0x7a8): undefined reference to `cv::resize(cv::_InputArray const&, cv::OutputArray const&, cv::Size, double, double, int)'

etc..

--

The SConstruct file in main_depth_anything, seems to overwrite the libabsl assignment in line 26 with the opencv lib* assignment in line 27. If I change the static file assignment like so...
...
static_file = Glob('../static_lib/module-llm/libabsl_*')
STATIC_LIB += static_file

static_file = []
static_file += [AFile('../static_lib/libopencv-4.6-aarch64-none/lib/libopencv_core.a')]
static_file += [AFile('../static_lib/libopencv-4.6-aarch64-none/lib/libittnotify.a')]
static_file += [AFile('../static_lib/libopencv-4.6-aarch64-none/lib/liblibjpeg-turbo.a')]
static_file += [AFile('../static_lib/libopencv-4.6-aarch64-none/lib/liblibopenjp2.a')]
static_file += [AFile('../static_lib/libopencv-4.6-aarch64-none/lib/liblibpng.a')]
static_file += [AFile('../static_lib/libopencv-4.6-aarch64-none/lib/liblibtiff.a')]
static_file += [AFile('../static_lib/libopencv-4.6-aarch64-none/lib/liblibwebp.a')]
static_file += [AFile('../static_lib/libopencv-4.6-aarch64-none/lib/libopencv_core.a')]
static_file += [AFile('../static_lib/libopencv-4.6-aarch64-none/lib/libopencv_highgui.a')]
static_file += [AFile('../static_lib/libopencv-4.6-aarch64-none/lib/libopencv_imgcodecs.a')]
static_file += [AFile('../static_lib/libopencv-4.6-aarch64-none/lib/libopencv_imgproc.a')]
static_file += [AFile('../static_lib/libopencv-4.6-aarch64-none/lib/libopencv_videoio.a')]
static_file += [AFile('../static_lib/libopencv-4.6-aarch64-none/lib/libtegra_hal.a')]
static_file += [AFile('../static_lib/libopencv-4.6-aarch64-none/lib/libzlib.a')]
STATIC_LIB += static_file * 2
...
it works fine.
My environment is Ubuntu 24.04 LTS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions