【问题标题】:cross-compile opencv for arm : c++: error: unrecognized command line option ‘-mthumb’; did you mean ‘-mtbm’?交叉编译opencv for arm:c++:错误:无法识别的命令行选项'-mthumb';你的意思是“-mtbm”吗?
【发布时间】:2019-01-13 07:49:09
【问题描述】:

我正在尝试为 Tinker Board - 基于 ARM 的处理器 - Rockchip RK3288 交叉编译 opencv 4.0/3.4

我使用 Ubuntu 18.04 作为主机。

我几乎遵循here 提到的所有内容。

但是当我尝试使用下面的 cmake 时:

mike@mike-laptop:~/opencv-3.4.5/build$ cmake -DCMAKE_TOOLCHAIN_FILE=../platforms/linux/arm-gnueabi.toolchain.cmake ../ I am getting the below error:

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: /usr/bin/c++ Build flags: -mthumb;;-fdata-sections;-Wa,--noexecstack;-fsigned-char;-Wno-psabi Id flags:

The output was: 1 c++: error: unrecognized command line option ‘-mthumb’; did you mean ‘-mtbm’?

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: /usr/bin/c++ Build flags: -mthumb;;-fdata-sections;-Wa,--noexecstack;-fsigned-char;-Wno-psabi Id flags: -c

The output was: 1 c++: error: unrecognized command line option ‘-mthumb’; did you mean ‘-mtbm’?

还有大量消息

【问题讨论】:

  • 我的 $PATH 中没有 arm 编译器,成功重现了您的错误。您是否按照说明安装了适当的工具链? (sudo apt-get install gcc-arm-linux-gnueabi)。你能确认安装的交叉编译器在你的$PATH 中,方法是在终端中输入arm- 并按tab 自动完成,看看它是否建议arm-eabi-gcc 和类似的东西?

标签: c++ opencv arm cross-compiling ubuntu-18.04


【解决方案1】:

我遇到了同样的问题。我试试

sudo apt-get install g++-arm-linux-gnueabi
sudo apt-get install g++-arm-linux-gnueabihf

我解决了。

希望对你有帮助!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-04-09
    • 2014-09-26
    • 2019-06-28
    • 2019-09-28
    • 2012-11-15
    • 1970-01-01
    • 2020-10-06
    相关资源
    最近更新 更多