a.cpp
#include <stdio.h>
#include <utils/Log.h>
int main(void) {
ALOGE("456");
printf("123\n");
return 0;
}
Android.bp
cc_binary {
name: "a021",
srcs: ["a.cpp"],
cflags: [
"-Wall",
"-Werror",
"-Wno-unused-parameter",
],
shared_libs: [
"liblog",
],
}
测试OK 。