将 FFTW 链接到 Android NDK 应用程序
我目前正在编写一个流派分类应用程序,作为我计算机工程的最后一年项目。我最初用 C 语言编写了特征提取代码(实现 FFTW),现在我需要通过 NDK 在 Android 上实现它。
这是我的第一个 NDK 项目,所以我仍在掌握窍门,但我已经根据 本指南。我没有执行最后一步,因为我认为这不适合我的需要。
我的问题是,在编译步骤之后,如何在调用它的主 NDK 应用程序中使用该库?我在 Application.mk 中的所有内容是否正常,只是将 LOCAL_STATIC_LIBRARIES 设置为我刚刚编译的 libfftw3.a ?然后我不需要像通常那样有任何 -lfftw3 链接器标志,对吗?
I am currently writing a genre classification application as my final year project in Computer Engineering. I initially wrote the feature extraction code (implementing FFTW) in C and now I need to implement it on Android via the NDK.
This is my first NDK project so I'm still getting the hang of things but I have compiled the FFTW3 library for Android according to this guide. I didn't do the very last step because I didn't think it was right for what I need.
My question is how do I, after the compile step, use the library in the main NDK application that calls on it? Do I everything normally in Application.mk just with LOCAL_STATIC_LIBRARIES set to the libfftw3.a that I just compiled? And then I don't need to have any -lfftw3 linker flags like I normally would right?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用预编译 FFTW 库(无论您如何构建它)。
或者您可以在
Android.mk
makefile 中使用整个项目构建 FFTW。Android.mk
内容为:我编写了
path_to_fftw_sources/$(LOCAL_MODULE).mk
用于构建 fftw 静态库和path_to_your_project/$(LOCAL_MODULE).mk< /code> 用于构建您的共享库。通常最好将
LOCAL_SRC_FILES
和LOCAL_C_INCLUDES
放入单独的.mk
文件中。您可以在 NDK 发行版的
docs/ANDROID-MK.html
文档中了解有关Android.mk
文件的更多信息。You can use prebuit FFTW library (no matter how did you build it).
Or you can build FFTW in
Android.mk
makefile with the whole project.Android.mk
content will be:I have written
path_to_fftw_sources/$(LOCAL_MODULE).mk
for building fftw static library andpath_to_your_project/$(LOCAL_MODULE).mk
for building your shared library. It is often better to putLOCAL_SRC_FILES
andLOCAL_C_INCLUDES
to the separate.mk
file.You can read more about
Android.mk
file indocs/ANDROID-MK.html
document in your NDK distribution.