两个c文件
a.c
void a();
b.c
#include "a.h"
a();
报错:error: undefined reference to 'a'
解决:CmakeLists.txt
target_link_libraries(b a)
unistd.h undefined reference to `cacheflush’
看看源码,需要声明特定处理器
#if defined(__arm__) || (defined(__mips__) && !defined(__LP64__))
int cacheflush(long __addr, long __nbytes, long __cache);
/* __attribute__((deprecated("use __builtin___clear_cache instead"))); */
#endif
解决:build.gradle文件
.........
externalNativeBuild {
cmake {
cppFlags ""
abiFilters 'armeabi-v7a'
}
}
.........
475



被折叠的 条评论
为什么被折叠?



