c++ - How can I link cpufeatures lib for a native android library? -
i'm trying link android's cpu_features native library.
i'm using android's gcc compiler directly cross compiler. (not ndk-build).
i've included header ($ndk_path/sources/android/cpufeatures/cpu-features.h), don't see prebuilt libcpufeatures.a file anywhere under ndk folder.
how can build library? or can found can link properly?
you can include source file cpu-features.c
in project, or build manually gcc:
arm-linux-androideabi-gcc -c cpu-features.c -o cpu-features.o --sysroot=$sysroot arm-linux-androideabi-ar rcs libcpufeatures.a cpu-features.o
it shouldn't require special compiler flags or defines, when linking it, may need add -ldl
since uses dlopen
.
Comments
Post a Comment