-1

Error stack trace:

    /usr/local/lib/libopencv_video.so.4.6.0: error adding symbols: File in wrong format
    collect2: error: ld returned 1 exit status

How to resolve this make error?

I already tried to build it after removing CMakeCache and other old build files.

Below is the CMakeLists.txt:

project(sample_camera C CXX)
pkg_check_modules(OPENCV opencv)

find_package(OpenCV REQUIRED COMPONENTS core imgproc video)
#-------------------------------------------------------------------------------
# Project files
#-------------------------------------------------------------------------------
set(PUBLIC_DOCS
    README.md
)

set(SOURCES
    main.cpp
)

set(LIBRARIES
    ${Driveworks_LIBRARIES}
    samples_framework
    lodepng-src
)

add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME} PRIVATE ${LIBRARIES}
    opencv_core 
        opencv_video
        opencv_imgproc)
...
  • Please provide minimum reproducible example, i.e. CMake / Makefile configuration of what you are trying to build – The Dreams Wind May 30 '22 at 11:38
  • @TheDreamsWind added CMakeLists.txt file – Tuhin Dutta May 30 '22 at 11:46
  • 1
    The error "File in wrong format" means that either the library file is **corrupted** or you are actually **cross-compiling**. BTW, you are searched for OpenCV library using even **two methods** (`pkg_check_modules` and `find_package`) but use results of neither of them. About proper using `find_package` for OpenCV see e.g. [that question](https://stackoverflow.com/questions/13970377/configuring-an-c-opencv-project-with-cmake). – Tsyvarev May 30 '22 at 12:04
  • @Tsyvarev, yes I'm cross-compiling. Now I'm only using find_package. What should be solution to this "File in wrong format" issue? – Tuhin Dutta May 31 '22 at 07:00

0 Answers0