报错
Bluetooth.c:(.text+0x80): undefined reference to `str2ba’
collect2: error: ld returned 1 exit status
: recipe for target ‘Bluetooth’ failed
make: *** [Bluetooth] Error 1
原因
str2ba函数属于bluetooth中的库函数,所以编译或者写make文件时的是时候需要额外链接该库,比如:
gcc -o Bluetooth Bluetooth.c -lbluetooth
链接该库之后,就不再报该错误