nihui/opencv-mobile

rk3588 调用opencv4存在问题,阿辉姑娘

sxj731533730 opened this issue · 2 comments

mpp解码cmakelists.txt

cmake_minimum_required(VERSION 2.8)

project(h264_mpp_yuv)
set(CMAKE_CXX_FLAGS "-std=c++11 ")

#find_package(OpenCV REQUIRED)
#include_directories(${OpenCV_INCLUDE_DIRS})
#MESSAGE(STATUS "OpenCV_DIR: ${OpenCV_DIR}")
#MESSAGE(STATUS "OpenCV_LIBS: ${OpenCV_LIBS}")
#MESSAGE(STATUS "OpenCV_VERSION: ${OpenCV_VERSION}")
#MESSAGE(STATUS "OpenCV_INSTALL_PATH: ${OpenCV_INSTALL_PATH}")
#MESSAGE(STATUS "OpenCV_INCLUDE_DIRS: ${OpenCV_INCLUDE_DIRS}")
set(OpenCV_DIR ${CMAKE_SOURCE_DIR}/opencv-mobile-4.6.0-armlinux/aarch64-linux-gnu/lib/cmake/opencv4)
find_package(OpenCV REQUIRED)

include_directories(${CMAKE_SOURCE_DIR}/include)
aux_source_directory(./mpp SRC_LIST) # 搜索当前目录下的所有.cpp文件,存储在变量SRC_LIST中
add_executable(h264_mpp_yuv main.cpp ${SRC_LIST})
target_link_libraries(h264_mpp_yuv rockchip_mpp drm ${OpenCV_LIBS})

报错结果

| ^
[100%] Linking CXX executable h264_mpp_yuv
/usr/bin/ld: ../opencv-mobile-4.6.0-armlinux/aarch64-linux-gnu/lib/libopencv_core.a(matrix_wrap.cpp.o): in function cv::_InputArray::getOGlBuffer() const': matrix_wrap.cpp:(.text._ZNK2cv11_InputArray12getOGlBufferEv+0x44): undefined reference to __libc_single_threaded'
/usr/bin/ld: matrix_wrap.cpp:(.text._ZNK2cv11_InputArray12getOGlBufferEv+0x48): undefined reference to __libc_single_threaded' /usr/bin/ld: ../opencv-mobile-4.6.0-armlinux/aarch64-linux-gnu/lib/libopencv_core.a(system.cpp.o): in function cv::TLSDatacv::CoreTLSData::deleteDataInstance(void*) const':
system.cpp:(.text._ZNK2cv7TLSDataINS_11CoreTLSDataEE18deleteDataInstanceEPv[_ZNK2cv7TLSDataINS_11CoreTLSDataEE18deleteDataInstanceEPv]+0x1c): undefined reference to __libc_single_threaded' /usr/bin/ld: system.cpp:(.text._ZNK2cv7TLSDataINS_11CoreTLSDataEE18deleteDataInstanceEPv[_ZNK2cv7TLSDataINS_11CoreTLSDataEE18deleteDataInstanceEPv]+0x20): undefined reference to __libc_single_threaded'
/usr/bin/ld: system.cpp:(.text._ZNK2cv7TLSDataINS_11CoreTLSDataEE18deleteDataInstanceEPv[_ZNK2cv7TLSDataINS_11CoreTLSDataEE18deleteDataInstanceEPv]+0x70): undefined reference to __libc_single_threaded' /usr/bin/ld: ../opencv-mobile-4.6.0-armlinux/aarch64-linux-gnu/lib/libopencv_core.a(system.cpp.o):system.cpp:(.text._ZN2cv7TLSDataINS_11CoreTLSDataEED2Ev[_ZN2cv7TLSDataINS_11CoreTLSDataEED5Ev]+0x138): more undefined references to __libc_single_threaded' follow
/usr/bin/ld: ../opencv-mobile-4.6.0-armlinux/aarch64-linux-gnu/lib/libopencv_core.a(system.cpp.o): in function `cv::utils::getConfigurationParameterPaths(char const*, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::alloc

低版本测试通过
cmake_minimum_required(VERSION 2.8)

project(h264_mpp_yuv)
set(CMAKE_CXX_FLAGS "-std=c++11 ")

#find_package(OpenCV REQUIRED)
#include_directories(${OpenCV_INCLUDE_DIRS})
#MESSAGE(STATUS "OpenCV_DIR: ${OpenCV_DIR}")
#MESSAGE(STATUS "OpenCV_LIBS: ${OpenCV_LIBS}")
#MESSAGE(STATUS "OpenCV_VERSION: ${OpenCV_VERSION}")
#MESSAGE(STATUS "OpenCV_INSTALL_PATH: ${OpenCV_INSTALL_PATH}")
#MESSAGE(STATUS "OpenCV_INCLUDE_DIRS: ${OpenCV_INCLUDE_DIRS}")
set(OpenCV_DIR ${CMAKE_SOURCE_DIR}/opencv-mobile-3.4.18-armlinux/aarch64-linux-gnu/lib/cmake/opencv4)
find_package(OpenCV REQUIRED)

include_directories(${CMAKE_SOURCE_DIR}/include)
aux_source_directory(./mpp SRC_LIST) # 搜索当前目录下的所有.cpp文件,存储在变量SRC_LIST中
add_executable(h264_mpp_yuv main.cpp ${SRC_LIST})
target_link_libraries(h264_mpp_yuv rockchip_mpp drm ${OpenCV_LIBS} )

我也遇到了