When I compile a demo main.cpp
, it failed because undefined reference to a_mtk_bt_service_init()
, but I have found the symbol by
nm -D ./libmtk_bt_service_client.so|grep a_mtk_bt_service_init
,
it's output is 0000000000004098 T a_mtk_bt_service_init
,
I'm sure the compiler found the correct dynamic library by use command aarch64-poky-linux-g++ -print-file-name=libmtk_bt_service_client.so -o main main.cpp
This is the demo code main.cpp
void a_mtk_bt_service_init();
int main()
{
a_mtk_bt_service_init();
return 0;
}
and my compile command is
aarch64-poky-linux-g++ -mcpu=cortex-a72.cortex-a53+crypto -mtune=cortex-a72.cortex-a53 --sysroot=/home/sundq/code/newT9/T9-Amazon-Sdk/build/tmp/sysroots/aud8516-slc -o build/xx main.cpp -I../../include -lmtk_bt_service_client