linux arm cross-compiling, problem with linking OpenCV so libraries

asked 2016-04-09 15:36:02 -0600

densvr gravatar image


I am building a c++ project for arm with OpenCV dependencies and getting some errors:

Linking CXX executable VehicleDetection
/home/densvr/lib/opencv/opencv-3.1.0/build_arm/lib/ file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
make[2]: *** [VehicleDetection] Error 1
make[1]: *** [CMakeFiles/VehicleDetection.dir/all] Error 2
make: *** [all] Error 2

OpenCV was successfully builded for arm according to instructions on

Please help me to find out how to fix this problem.

Here is my project's CMakeLists.txt:

cmake_minimum_required(VERSION 2.8.0 FATAL_ERROR) # Проверка версии CMake.
                                    # Если версия установленой программы
                                    # старее указаной, произайдёт аварийный выход.

project( VehicleDetectionDemo )

set( CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
set( CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)

#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
find_package( OpenCV REQUIRED )

add_executable( VehicleDetection 
    #src files

target_link_libraries( VehicleDetection ${OpenCV_LIBS} )
edit retag flag offensive close merge delete