1

我遵循了本教程,基于 ARM 的 Linux 系统的交叉编译,以便为基于 ARM 的 Linux 系统(在ODROID-XU4 Mini PC上运行的 Ubuntu Mate )构建Opencv版本 3.3.1 。对于我正在运行的构建过程。cmakeUbuntu Mate v 16.04.1 x86

请注意,我已经尝试按照本教程(Linux 中的 Opencv 安装)Opencv为我正在运行的机器构建相同的版本,并且我成功地做到了。但是,在使用同一台机器为 ARM 构建它时,出现以下错误。Intel x86 Ubuntu based

-- The CXX compiler identification is unknown
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:114 (project):
  No CMAKE_CXX_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:114 (project):
  No CMAKE_C_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
See also "/home/jhon/Programs/opencv-3.3.1/arm/CMakeFiles/CMakeOutput.log".
See also "/home/jhon/Programs/opencv-3.3.1/arm/CMakeFiles/CMakeError.log".

这是生成此错误的命令行:

cmake -DCMAKE_TOOLCHAIN_FILE=../platforms/linux/arm-gnueabi.toolchain.cmake ..

请注意,该选项-DCMAKE_TOOLCHAIN_FILE告诉我们cmake为基于 ARM 的 Linux 系统构建 Opencv,当我尝试删除它时,我成功地Opencv为我的 x86 机器构建了没有任何错误的机器。

提前致谢。

4

2 回答 2

1

OpenCV 文档告诉只安装C交叉编译器(包gcc-arm-linux-gnueabi),但实际上 OpenCV 也需要C++编译器。

所以还需要安装g++-arm-linux-gnueabi包。

于 2018-01-31T14:24:54.833 回答
0

我一直想知道为什么没有用于 Opencv-Linux 的预构建二进制文件(我仍然不知道为什么)所以在这里我将我的工作放给公众以从中受益,其中包括 Opencv 3.3.1 预构建版本Linux x86、x64 和 armv7hf(包括相应的 java 二进制文件)。

OpenCV Linux x86、x62 和 armv7hf 二进制文件

于 2018-02-09T10:07:16.157 回答