【发布时间】:2017-01-25 12:42:16
【问题描述】:
我正在尝试交叉编译 opencv,但它失败并显示 cvdef.h:314:5: error: '__fp16' does not name a type。
交叉编译器具有 hf 支持和 fp16 扩展。
... --enable-languages=c,c++ --with-cpu=cortex-a53 --with-fpu=vfpv3-fp16 --with-float=hard --with-pkgversion='crosstool-NG crosstool-ng-1.22.0' --enable-__cxa_atexit --disable-libmudflap --disable-libgomp - -disable-libssp --disable-libquadmath ...
我尝试在 cmake 文件中设置额外的标志:
set(GCC_COMPILER_VERSION "5.2.0" CACHE STRING "GCC 编译器版本") set(GNU_MACHINE "arm-linux-gnueabihf" CACHE STRING "GNU 编译器 三倍”)
设置(CMAKE_CXX_FLAGS“-mfloat-abi=hard -mfp16-format=ieee”)
设置(CMAKE_C_FLAGS“-mfloat-abi=hard -mfp16-format=ieee”)include("${CMAKE_CURRENT_LIST_DIR}/arm.toolchain.cmake")
但看起来标志被忽略了。 cmake 配置输出:
-- C++ 标志(发布):-fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-安全性 -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-帧指针 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -O2 -DNDEBUG -DNDEBUG
感谢您的帮助。
【问题讨论】:
标签: c++ opencv cross-compiling