ncnn使用GPU时报error: undefined reference to *******
导读
根据ncnn的官方教程使用vulkan-sdk编译了一个带gpu功能的libncnn.a库,官方教程如下:
https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-windows-x64-using-visual-studio-community-2017
详细错误
../../../../src/main/cppLibs/ncnn/lib/armeabi-v7a/libncnn.a(modelbin.cpp.o):modelbin.cpp:function ncnn::ModelBinFromDataReader::load(int, int) const: error: undefined reference to 'stderr'
../../../../src/main/cppLibs/ncnn/lib/armeabi-v7a/libncnn.a(modelbin.cpp.o):modelbin.cpp:function ncnn::ModelBinFromDataReader::load(int, int) const: error: undefined reference to 'stderr'
../../../../src/main/cppLibs/ncnn/lib/armeabi-v7a/libncnn.a(modelbin.cpp.o):modelbin.cpp:function ncnn::ModelBinFromDataReader::load(int, int) const: error: undefined reference to 'stderr'
../../../../src/main/cppLibs/ncnn/lib/armeabi-v7a/libncnn.a(modelbin.cpp.o):modelbin.cpp:function ncnn::ModelBinFromDataReader::load(int, int) const: error: undefined reference to 'stderr'
../../../../src/main/cppLibs/ncnn/lib/armeabi-v7a/libncnn.a(allocator.cpp.o):allocator.cpp:function ncnn::VkAllocator::flush(ncnn::VkBufferMemory*): error: undefined reference to 'vkFlushMappedMemoryRanges'
../../../../src/main/cppLibs/ncnn/lib/armeabi-v7a/libncnn.a(allocator.cpp.o):allocator.cpp:function ncnn::VkAllocator::invalidate(ncnn::VkBufferMemory*): error: undefined reference to 'vkInvalidateMappedMemoryRanges'
../../../../src/main/cppLibs/ncnn/lib/armeabi-v7a/libncnn.a(allocator.cpp.o):allocator.cpp:function ncnn::VkAllocator::create_buffer(unsigned int, unsigned int): error: undefined reference to 'vkCreateBuffer'
../../../../src/main/cppLibs/ncnn/lib/armeabi-v7a/libncnn.a(allocator.cpp.o):allocator.cpp:function ncnn::VkAllocator::allocate_memory(unsigned int): error: undefined reference to 'vkAllocateMemory'
../../../../src/main/cppLibs/ncnn/lib/armeabi-v7a/libncnn.a(allocator.cpp.o):allocator.cpp:function ncnn::VkAllocator::allocate_dedicated_memory(unsigned int, unsigned long long): error: undefined reference to 'vkAllocateMemory'
../../../../src/main/cppLibs/ncnn/lib/armeabi-v7a/libncnn.a(allocator.cpp.o):allocator.cpp:function ncnn::VkBlobBufferAllocator::clear(): error: undefined reference to 'vkDestroyBuffer'
../../../../src/main/cppLibs/ncnn/lib/armeabi-v7a/libncnn.a(allocator.cpp.o):allocator.cpp:function ncnn::VkBlobBufferAllocator::clear(): error: undefined reference to 'vkFreeMemory'
../../../../src/main/cppLibs/ncnn/lib/armeabi-v7a/libncnn.a(allocator.cpp.o):allocator.cpp:function ncnn::VkBlobBufferAllocator::clear(): error: undefined reference to 'vkUnmapMemory'
../../../../src/main/cppLibs/ncnn/lib/armeabi-v7a/libncnn.a(allocator.cpp.o):allocator.cpp:function ncnn::VkBlobBufferAllocator::fastMalloc(unsigned int): error: undefined reference to 'vkCreateBuffer'
解决办法
我在编译Android工程的时候,采用的是build.gradle和CMakeLists.txt文件来进行配置的,如果你是使用的Android.mk和application.mk文件可能配置上会有些区别
- build.gradle文件中添加以下内容
想要使用GPU功能,Android的版本必须在24(Android7.0)以上
android {defaultConfig {minSdkVersion 24//应用支持Android的最低版本externalNativeBuild {cmake {arguments "-DANDROID_PLATFORM=android-24"//设置编译so文件的时候Android的版本}}}
}
- CMakeLists.txt文件中添加如下内容
target_link_libraries( # Specifies the target library.jnigraphicsvulkan)
- Android.mk文件添加如下内容
LOCAL_LDLIBS := -lz -llog -ljnigraphics -lvulkan -landroid
application.mk中添加
APP_PLATFORM := android-24
ncnn使用GPU时报error: undefined reference to *******相关推荐
- 【ffmpeg】编译时报错:error: undefined reference to `av...
1.问题描述 昨天使用ffmpeg库编译demo一切正常,今天再次链接ffmpeg库时报了一堆错误: error: undefined reference to `av_frame_alloc()' ...
- 【Qt】error: undefined reference to `vtable for MainWindow‘
1.问题描述 在写一个demo时,想尽量简单,就把MainWindow类的定义和实现都写在main.cpp中,结果编译时报错: main.cpp:-1: error: undefined refere ...
- error: undefined reference to `calculate()`报错
在调用xx.h和xx.c中的函数,比如calculate()时 如下: #include "xx.h" int t; int result = calculate(t); 此时报错 ...
- 【Qt】报错error: undefined reference to `vtable for的解决方法
1.问题描述 编译Qt程序时,在某个类构造函数定义处报错: error: undefined reference to `vtable for 2.原因分析 导致错误信息的原因是:子类没有实现父类的纯 ...
- error undefined reference to __android_log_print
error undefined reference to '__android_log_print 配置 Android.mk文件 输入 LOCAL_LDLIBS := -llog 打印日志库 注意: ...
- 【错误记录】Android NDK 错误排查记录 ( error: undefined reference to | Linking CXX shared library FAILED )
文章目录 一. 报错信息 二. 错误分析 三. 错误总结 一. 报错信息 报错信息 : Build command failed. Error while executing process Y:\0 ...
- Android系统编译so库提示error undefined reference to '__android_log_print问题的解决
在系统源代码的hardware/qcom下增加psam文件夹,编译源代码要生成libpsam.so库,Android.mk内容 LOCAL_PATH := $(call my-dir) include ...
- pthread_create函数编译时报错:undefined reference to 'pthread_create'
错误: pthread_create函数编译时报错:undefined reference to 'pthread_create' pthread_create()和pthread_atfork()函 ...
- android error: undefined reference to 的错误分析
今天,简单讲讲android error: undefined reference to 的错误分析. 昨天,做jni,连接so库时,android studio出现了这个问题.当时不知道是什么 ...
- 解决Error: undefined reference to `__android_log_print'
解决Error: undefined reference to `__android_log_print' 最近在使用Android Studio进行NDK开发时,程序本身是没有问题,但一旦添 ...
最新文章
- js点击获取连接的内容
- MFC 学习的基本概念
- mysql 数据表创建字段类型_MySQL 数据类型简介 创建数据表及其字段约束
- 96. 不同的二叉搜索树
- LeetCode 1586. 二叉搜索树迭代器 II(数组+栈)
- spring aop实现日志收集
- 在线教育app平台搭建招生系统教培系统源码
- 初识powerpoint的计算机教案,《初识PowerPoint》教案
- 专业的压缩解压缩工具 WinZip Pro 7 for Mac
- 【提高组NOIP2007】矩阵取数游戏
- 修改数据库长度mysql_mysql 修改数据库长度
- 服务器对接qq微信聊天,java仿QQ微信聊天室功能的实现
- 4412开发板项目实战-云服务器智能家居
- 欧几里德算法(Euclidean algorithm)
- EDK2编译环境搭建、编译、在模拟器运行、在笔记本运行
- python添加文字水印中间旋转45度,Python添加pdf水印
- djyvp2计算机电缆哪家好,ZA-DJYVP22-2*2*1.5计算机电缆
- 用Python爬取wallhaven高清原图
- [每天读一点英文]Obama就职典礼演说gnuhpc标注版
- [UE5蓝图基础二]11.[蒙太奇动画调用] 释放火球--实现火球抛射二
热门文章
- MATLAB实现imrotate函数
- mean shift segmentation matlab,Mean Shift图像分割算法的并行化
- 您的计算机性能不足 无法运行,绝地求生进不去游戏提示运行引擎需要DX11特性等级10.0,大神救我,刚做的系统W10 64位的,游戏也是刚下的...
- 支付宝小程序链接跳转异常处理方法
- C语言学习(一)软件篇
- 笔记本电脑电源和电池充电管理电路设计
- 第五人格显示服务器维护中请稍后登录怎么办,第五人格维护登不上怎么办 服务器维护中详情...
- 计算机系统时microsoft账号是,电脑microsoft账户登不进去
- EnergyPlus笔记
- WinZip for Mac注册版