我遵循了本教程,Cross compilation for ARM based Linux systems , 为了使用 cmake
为基于 ARM 的 Linux 系统构建 Opencv
版本 3.3.1(运行在 ODROID-XU4 Mini PC 上的 Ubuntu Mate)。对于构建过程,我正在运行 Ubuntu Mate v 16.04.1 x86
。
请注意,我已经按照本教程 Opencv Installation in Linux 尝试为我的 Intel x86 Ubuntu based
运行机器构建相同版本的 Opencv
,我成功做到了。但是,当使用同一台机器为 ARM 构建它时,出现以下错误。
-- 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,当我尝试删除它时,我成功地结束了为我的 x86 机器构建 Opencv
,没有任何错误。
提前致谢。
最佳答案
OpenCV 文档告诉你只安装C 交叉编译器(package gcc-arm-linux-gnueabi
),但实际上 OpenCV 需要 C++编译器也是。
所以还需要安装g++-arm-linux-gnueabi
包。
关于c++ - OpenCV v3.3.1 ARM 交叉编译失败 : No CMAKE_CXX_COMPILER could be found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48542972/