板球音频引擎CMAKE

时间:2017-10-16 18:34:15

标签: android cmake android-ndk

是否有人使用gradle和Cmake(Android NDK)为Android Studio实施了Cricket音频引擎(http://www.crickettechnology.com/blog/)?

我已经在我的Cmake中导入了这样的lib:

target_link_libraries(test
${CMAKE_CURRENT_SOURCE_DIR}/../../test/cricketaudio/lib/libck.a)

编译器看到它没问题但是当我尝试运行它时,链接器给了我这个错误:

Error while executing process    
[1/1] Linking CXX shared library 
..\..\..\..\build\intermediates\cmake\development\debug\obj\armeabi-
v7a\libtest.so
FAILED: cmd.exe -soname,libtest.so -o 
..\..\..\..\build\intermediates\cmake\development\debug\obj\armeabi-
v7a\libtest.so @CMakeFiles/test.rsp  && cd ."
core/system_android.cpp:174: error: undefined reference to 
'android_getCpuFamily'
core/system_android.cpp:187: error: undefined reference to 
'android_getCpuFeatures'
core/system_android.cpp:210: error: undefined reference to 
'android_getCpuCount'
clang++.exe: error: linker command failed with exit code 1 (use -v to see 
invocation)
ninja: build stopped: subcommand failed.

我知道libck(板球音频)有一个依赖lib,Android NDK cpufeauters lib位于Android NDK包中( Android \ Sdk \ ndk-bundle \ sources \ android \ cpufeatures )。

我不知道如何让这个 cpufeatures 库对我项目的链接器可见???

任何帮助或指示都将不胜感激。

1 个答案:

答案 0 :(得分:1)

我只是将cpu-features.c和头文件包含在我的cmakelist中,现在它可以工作了:)。