How to build and debug native code (c) with neon enabled in android studio?
我指的是它是否可以调试-c-c-in-android-studio? Yuchen Zhong 的最后一个回答并做了一些基本的例子,我也可以构建和调试。
所以现在我正在尝试使用我的旧应用程序项目来做同样的事情。我的旧应用程序 buil.gradle 是
1
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
apply plugin: ‘com.android.application’
android { compileSdkVersion 18 buildToolsVersion“23.0.1” defaultConfig { sourceSets.main { } buildTypes { |
更新了 build.gradle,所以我可以通过 android studio 调试我的代码。
1
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
apply plugin: ‘com.android.model.application’
model { defaultConfig.with { android.ndk { abiFilters.add(“armeabi-v7a”) } } dependencies { |
但是在构建时我得到了错误
prebuilt\\windows-x86_64\\lib\\gcc\\arm-linux-androideabi\\4.9\\include\\arm_neon.h
Error:(31, 2) error: #error You must enable NEON instructions (e.g.
-mfloat-abi=softfp -mfpu=neon) to use arm_neon.h
我不知道如何解决这个问题,因为我也提到了 cflag。
请帮我解决这个错误,如果还有更多错误,请更正我。
- 可能是一个愚蠢的问题,但是 C 还是 C ?
- 两个都。核心模块在 C 中,接口文件在 C 中。
- CXXFlags 没有成功。
您的 Application.mk 文件是什么样的?添加
APP_CFLAGS := -mfloat-abi=softfp -mfpu=neon 到 Application.mk 应该可以修复错误。
来源:https://www.codenong.com/36277243/