8000 app problem · Issue #38 · Tencent/ncnn · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

app problem #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
eeric opened this issue Jul 26, 2017 · 13 comments
Closed

app problem #38

eeric opened this issue Jul 26, 2017 · 13 comments

Comments

@eeric
Copy link
eeric commented Jul 26, 2017

error as following:
undefined reference to 'ncnn:Net::load_param(unsigned char const*)'
undefined reference to 'ncnn:Net::load_model(unsigned char const*)'
undefined reference to 'ncnn:Net::from_pixels(unsigned char const*,int,int,int)'
........
undefined reference to 'ncnn:Net::Net()'
undefined reference to 'ncnn:Net::~Net()'
error:linker command failed with exit code 1 (use -v to see invocation)

@noiplcx
Copy link
noiplcx commented Jul 26, 2017

刚刚我也遇到这个错误了

$ export ANDROID_NDK=/absolute/path/to/the/android-ndk

$ mkdir build && cd build

$ cmake -DCMAKE_TOOLCHAIN_FILE=path/to/the/android.toolchain.cmake ..

$ make -j8

$ make install

亲测可用

@eeric
Copy link
Author
eeric commented Jul 26, 2017

@noiplcx,你是在linux下生成libncnn.a,又在linux下编译jni的吗?

@eeric
Copy link
Author
eeric commented Jul 27, 2017

@noiplcx,试过了,会提示2个错误,后来按官网cmake打包android-sdk配置环境,成功生成libsqueezencnn.so,地址:https://github.com/Tencent/ncnn/wiki/cmake-打包-android-sdk,
之后也能运行app,但要注意assets文件夹在android studio工程中的位置。

@devil2028
Copy link

@eeric 能分享个 .so文件用吗?

@dangbo
Copy link
dangbo commented Jul 29, 2017

https://github.com/dangbo/ncnn-mobile use ncnn in Android and iOS

@ghost
Copy link
ghost commented Aug 1, 2017

@eeric 我按照cmake打包android-sdk的说明,最后结果如下,并没有生成.so 文件,请教下是什么问题
➜ build-android git:(master) ✗ make install
[100%] Built target ncnn
Install the project...
-- Install configuration: "release"
-- Installing: /Users/yangguangdejianjian/code/ncnn/build-android/install/lib/libncnn.a
-- Installing: /Users/yangguangdejianjian/code/ncnn/build-android/install/include/blob.h
-- Installing: /Users/yangguangdejianjian/code/ncnn/build-android/install/include/cpu.h
-- Installing: /Users/yangguangdejianjian/code/ncnn/build-android/install/include/layer.h
-- Installing: /Users/yangguangdejianjian/code/ncnn/build-android/install/include/mat.h
-- Installing: /Users/yangguangdejianjian/code/ncnn/build-android/install/include/net.h
-- Installing: /Users/yangguangdejianjian/code/ncnn/build-android/install/include/opencv.h
-- Installing: /Users/yangguangdejianjian/code/ncnn/build-android/install/include/platform.h
➜ build-android git:(master) ✗ make package
make: *** No rule to make target `package'. Stop.
➜ build-android git:(master) ✗

@eeric
Copy link
Author
eeric commented Aug 1, 2017

@jj8401
按照https://github.com/Tencent/ncnn/wiki/cmake-打包-android-sdk,把这句-DANDROID_NATIVE_API_LEVEL=android-8,改成高版本的,比如android-18等,
另外,这句make package不需要,在obj文件夹或者lib文件夹内应该有的

@ghost
Copy link
ghost commented Aug 1, 2017

@eeric 我已经改过了 生成的.so文件有1.5m大小,相比官方参考的那个app里的.so文件270kb,想问下您生成的士多大,有没有影响

@eeric
Copy link
Author
eeric commented Aug 2, 2017

@jj8401,我的1.23M,这个大小与你的编译工具有关吧

@ghost
Copy link
ghost commented Aug 2, 2017

@eeric 非常感谢

@nihui nihui closed this as completed Sep 30, 2017
@enduringstack
Copy link

@eeric 你的NDK版本和CMAKE版本能说下吗

@eeric
Copy link
Author
eeric commented Oct 11, 2017

@enduringstack
android-ndk-r13b以上版本就可以了
cmake 3.22

@zym1119
Copy link
zym1119 commented Oct 28, 2018

@jj8401
按照https://github.com/Tencent/ncnn/wiki/cmake-打包-android-sdk,把这句-DANDROID_NATIVE_API_LEVEL=android-8,改成高版本的,比如android-18等,
另外,这句make package不需要,在obj文件夹或者lib文件夹内应该有的

请问您的.so文件是在make install以后就有的么?还是在jni文件夹内ndk_build后才生成的?
而且我在make install后build-android文件夹内也没有obj或者lib文件夹啊?
我在ndk_build的时候报错unresolved reference to ncnn::Net::load_param()等,请问您知道是怎么回事么

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants
0