在Ubuntu 16中编译开启NEON优化的Opencv时,遇到libpng编译是使用汇编代码的错误,完整错误见文章末尾。通过查询发现解决方案是安装跨平台编译器,安装代码如下:

sudo apt-get install gcc-arm-linux-gnueabi

sudo apt-get install gcc-arm-linux-gnueabihf

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

在参考1中说的是用OCV源码中的toolchain_file,但是我用这个编译出来的会导致各种undefin reference,还是要用NDK中的toolchai_file才行

参考1

参考2

[ 17%] Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/arm/arm_init.c.o
[ 17%] Building ASM object 3rdparty/libpng/CMakeFiles/libpng.dir/arm/filter_neon.S.o
<instantiation>:18:9: error: unknown directive
.func png_read_filter_row_sub4_neon
^
/home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:65:1: note: while in macro instantiation
func png_read_filter_row_sub4_neon, export=1
^
<instantiation>:2:9: error: unknown directive
.endfunc
^
/home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:79:1: note: while in macro instantiation
endfunc
^
<instantiation>:18:9: error: unknown directive
.func png_read_filter_row_sub3_neon
^
/home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:81:1: note: while in macro instantiation
func png_read_filter_row_sub3_neon, export=1
^
<instantiation>:2:9: error: unknown directive
.endfunc
^
/home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:105:1: note: while in macro instantiation
endfunc
^
<instantiation>:18:9: error: unknown directive
.func png_read_filter_row_up_neon
^
/home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:107:1: note: while in macro instantiation
func png_read_filter_row_up_neon, export=1
^
<instantiation>:2:9: error: unknown directive
.endfunc
^
/home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:118:1: note: while in macro instantiation
endfunc
^
<instantiation>:18:9: error: unknown directive
.func png_read_filter_row_avg4_neon
^
/home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:120:1: note: while in macro instantiation
func png_read_filter_row_avg4_neon, export=1
^
<instantiation>:2:9: error: unknown directive
.endfunc
^
/home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:139:1: note: while in macro instantiation
endfunc
^
<instantiation>:18:9: error: unknown directive
.func png_read_filter_row_avg3_neon
^
/home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:141:1: note: while in macro instantiation
func png_read_filter_row_avg3_neon, export=1
^
<instantiation>:2:9: error: unknown directive
.endfunc
^
/home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:174:1: note: while in macro instantiation
endfunc
^
<instantiation>:18:9: error: unknown directive
.func png_read_filter_row_paeth4_neon
^
/home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:192:1: note: while in macro instantiation
func png_read_filter_row_paeth4_neon, export=1
^
<instantiation>:2:9: error: unknown directive
.endfunc
^
/home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:213:1: note: while in macro instantiation
endfunc
^
<instantiation>:18:9: error: unknown directive
.func png_read_filter_row_paeth3_neon
^
/home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:215:1: note: while in macro instantiation
func png_read_filter_row_paeth3_neon, export=1
^
<instantiation>:2:9: error: unknown directive
.endfunc
^
/home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:250:1: note: while in macro instantiation
endfunc
^
3rdparty/libpng/CMakeFiles/libpng.dir/build.make:446: recipe for target '3rdparty/libpng/CMakeFiles/libpng.dir/arm/filter_neon.S.o' failed
make[2]: *** [3rdparty/libpng/CMakeFiles/libpng.dir/arm/filter_neon.S.o] Error 1
CMakeFiles/Makefile2:655: recipe for target '3rdparty/libpng/CMakeFiles/libpng.dir/all' failed
make[1]: *** [3rdparty/libpng/CMakeFiles/libpng.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

解决一个Ubuntu中编译NEON优化的OpenCV的错误的更多相关文章

  1. 解决在ubuntu中安装或升级时出现“11:资源暂时不可用”错误

    解决在ubuntu中安装或升级时出现“11:资源暂时不可用”错误 解决在ubuntu中安装或升级时出现“11:资源暂时不可用”错误. 下图为具体情况: 出现问题: termial下在执行sudo ap ...

  2. 解决一个C#中定时任务被阻塞问题

    解决一个C#中定时任务被阻塞问题 目录 解决一个C#中定时任务被阻塞问题 1.摘要 2.C#中定时任务的最简方法 3.定时任务阻塞现象 4.阻塞现象原因分析 5.问题解决 1.摘要 本文会介绍一个C# ...

  3. android在ubuntu中编译为.apk资料

    android在ubuntu中编译为.apk文件 今天我在ubuntu环境之下将android程序编译为.apk文件,特将其过程写下来: 1. 在windows环境下使用MyEclipse编辑好and ...

  4. 解决配置Ubuntu中vnc远程显示灰屏

    解决配置Ubuntu中vnc远程显示灰屏a. 缺失图形化工具b.  ~/.vnc/xstartup 权限不对1. Ubuntu 16.04 安装 VNC 及 Mate 桌面环境https://www. ...

  5. ubuntu中编译安装gcc 9.2.0

    一切都和其他源码安装软件是一样的: 一.下载源代码: http://ftp.gnu.org/gnu/gcc/gcc-9.2.0/gcc-9.2.0.tar.xz 二.解压文件 tar xvf gcc- ...

  6. 配置android source 在ubuntu中编译环境

    在Ubuntu中可以配置 android source 编译环境,推荐使用最新的64位的Ubuntu  LTS(Long Time Support); 1.安装JDK. AOSP主分支代码需要java ...

  7. 在Ubuntu中编译QT工程Tesful

    今天晚上开机到Ubuntu中了,试了一下之前在Windows下建立的Tesful工程,发现没有任何改动就可以编译成功/运行. 附上图:

  8. 今天遇到一件开心事,在eclipse编写的代码在命令窗口中编译后无法运行,提示 “错误: 找不到或无法加载主类”

    java中带package和不带package的编译运行方式是不同的. 首先来了解一下package的概念:简单定义为,package是一个为了方便管理组织java文件的目录结构,并防止不同java文 ...

  9. 解决VB6.0中不能加载MSCOMCTL.OCX的错误提示

    VB6.0毕竟是很古老的开发工具了,其对所使用的第三方组件依赖性比较强,例如在打开从其它电脑上拿来的VB6.0的软件(系统)的工程文件(源代码)时,经常会遇到"不能加载MSCOMCTL.OC ...

随机推荐

  1. Dubbo工作原理,集群容错,负载均衡

    Remoting:网络通信框架,实现了sync-over-async和request-response消息机制. RPC:一个远程过程调用的抽象,支持负载均衡.容灾和集群功能. Registry:服务 ...

  2. [Swift]LeetCode669. 修剪二叉搜索树 | Trim a Binary Search Tree

    Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that a ...

  3. [Swift]LeetCode725. 分隔链表 | Split Linked List in Parts

    Given a (singly) linked list with head node root, write a function to split the linked list into k c ...

  4. [Swift]LeetCode818. 赛车 | Race Car

    Your car starts at position 0 and speed +1 on an infinite number line.  (Your car can go into negati ...

  5. [Swift]LeetCode841. 钥匙和房间 | Keys and Rooms

    There are N rooms and you start in room 0.  Each room has a distinct number in 0, 1, 2, ..., N-1, an ...

  6. oracle 合并多个sys_refcursor

    一.背景 在数据开发中,有时你需要合并两个动态游标sys_refcursor. 开发一个存储过程PROC_A,这个过程业务逻辑相当复杂,代码篇幅较长.一段时间后要开发一个PROC_B,要用PROC_A ...

  7. Linux中FTP远程传输,SSH远程连接,以及SCP远程拷贝

    常用服务器ftp.ssh 1. Linux常用服务器构建-ftp服务器 ftp服务器 FTP 是File Transfer Protocol(文件传输协议)的英文简称,而中文简称为“文传协议”. 用于 ...

  8. python网络-计算机网络基础(23)

    一.网络简介 网络是由节点和连线构成,表示诸多对象及其相互联系. 一个人玩: 两个人玩: 多个人玩: 说明 网络就是一种辅助双方或者多方能够连接在一起的工具 如果没有网络可想单机的世界是多么的孤单 使 ...

  9. [武汉集训] Cliquers

    题意 设把\(n\)个不同元素分成若干个大小相等的集合的方案个数为\(res\),求\(m^{res}\)模\(10^9-401\)后的余数. (n,m不超过2*10^9) 分析 可以知道,所求答案为 ...

  10. 解决SpringMVC中文乱码问题--这是前端传参数到服务器

    SpringMvc参数传递中乱码问题   问题描述: 当传递中文参数到controller类时,无乱是get方式还是post方式都出现乱码 解决: 1.保证所有的页面编码都是utf-8,包括jsp页面 ...