I need to use cutils library and headers to implement ashmem on my NDK project but I could not find anything related to cutils in my system. Where is it located or from where can I obtain it?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
The Android "cutils" library, found in the sources at system/core/libcutils, is not part of the NDK. The code there changes with every release, so it's not something you can rely on.
The best approach for now is to copy the source for the relevant portions of the library into your project.
回答2:
If you don't mind about compatibility, you can get the libcutils.so
from your connected device or emulator.
adb pull /system/lib/libcutils.so
This is good for development or for private use; for release just copy the source of the things you need into your own project.