我正在尝试在基于 ARM-linux 的系统上编译 OPENCV。为此,我创建了一个带有以下选项的工具链 cmake 文件
SET (CMAKE_SYSTEM_NAME Linux)
SET (CMAKE_SYSTEM_VERSION 1)
SET (CMAKE_SYSTEM_PROCESSOR arm)
SET (CMAKE_C_COMPILER "/usr/local/arm/4.3.1-eabi-armv6/usr/bin/arm-linux-gcc")
SET (CMAKE_CXX_COMPILER "/usr/local/arm/4.3.1-eabi-armv6/usr/bin/arm-linux-g++")
SET (CMAKE_FIND_ROOT_PATH "/usr/local/arm/4.3.1-eabi-armv6/")
SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
SET (LIBRARY_OUTPUT_PATH "/home/xxx/OpenCV-2.4.3/lib")
SET (OPENCV_CONFIG_FILE_INCLUDE_DIR "/home/xxx/OpenCV-2.4.3")
SET (OPENCV_WARNINGS_ARE_ERRORS OFF)
运行 cmake 命令和 make 命令后,出现以下错误:
In file included from /usr/local/arm/4.3.1-eabi-armv6/usr/bin-ccache/../lib/gcc/arm-samsung-linux-gnueabi/4.3.1/../../../../arm-samsung-linux-gnueabi/include/c++/4.3.1/bits/postypes.h:47,
from /usr/local/arm/4.3.1-eabi-armv6/usr/bin-ccache/../lib/gcc/arm-samsung-linux-gnueabi/4.3.1/../../../../arm-samsung-linux-gnueabi/include/c++/4.3.1/iosfwd:47,
from /usr/local/arm/4.3.1-eabi-armv6/usr/bin-ccache/../lib/gcc/arm-samsung-linux-gnueabi/4.3.1/../../../../arm-samsung-linux-gnueabi/include/c++/4.3.1/ios:44,
from /usr/local/arm/4.3.1-eabi-armv6/usr/bin-ccache/../lib/gcc/arm-samsung-linux-gnueabi/4.3.1/../../../../arm-samsung-linux-gnueabi/include/c++/4.3.1/ostream:45,
from /usr/local/arm/4.3.1-eabi-armv6/usr/bin-ccache/../lib/gcc/arm-samsung-linux-gnueabi/4.3.1/../../../../arm-samsung-linux-gnueabi/include/c++/4.3.1/iostream:45,
from /home/zwang/OpenCV-2.4.3/3rdparty/openexr/Half/half.h:88,
from /home/zwang/OpenCV-2.4.3/3rdparty/openexr/Half/half.cpp:48:
/usr/local/arm/4.3.1-eabi-armv6/usr/bin-ccache/../lib/gcc/arm-samsung-linux-gnueabi/4.3.1/../../../../arm-samsung-linux-gnueabi/include/c++/4.3.1/cwchar:52:24: error: wchar.h: No such file or directory
总结:编译器找不到wchar.h、stdio.h、wctype.h、ctype.h。这些标头位于 /usr/local/arm/4.3.1-eabi-armv6/usr/include 中。我想我需要使用 cmake 选项包含这个文件夹。我怎样才能做到这一点?