android 8.0 底层调用动态库链接错误
修改hardware\interfaces\bluetooth\1.0\default\h4_protocol.cc 添加函数property_get,再修改hardware\interfaces\bluetooth\1.0\default\Android.bp添加动态库libcutils
修改前
cc_library_static {
name: "android.hardware.bluetooth-hci",
vendor: true,
defaults: ["hidl_defaults"],
srcs: [
"hci_packetizer.cc",
"hci_protocol.cc",
"h4_protocol.cc",
"mct_protocol.cc",
],
export_include_dirs: ["."],
shared_libs: [
"libbase",
"libhidlbase",
"liblog",
"libutils",
],
}
修改后
cc_library_static {
name: "android.hardware.bluetooth-hci",
vendor: true,
defaults: ["hidl_defaults"],
srcs: [
"hci_packetizer.cc",
"hci_protocol.cc",
"h4_protocol.cc",
"mct_protocol.cc",
],
export_include_dirs: ["."],
shared_libs: [
"libbase",
"libhidlbase",
"liblog",
"libutils",
"libcutils",
],
}
执行mmm -j24 hardware/interfaces/bluetooth/
提示链接错误 error: undefined reference to 'property_get'
但如果make clean && make -j24 则编译通过,求解