bluetooth - Linking with libbluetooth.so -
At Ubuntu 14.04, I'm trying to make a small case of Bluetooth device entry but I face a simple problem Comparing this minimalistic demo when connecting with the Bluetooth Shared Library:
The Bluetooth shared library is found and is being done with essential functions, but adding does not achieve the phase.
The solution (for me) is astonishing: the sequence of arguments given to GCC is important. "-blblutooth" should be named after "simplescan.c":
$ gcc simplescan.c -lbluetooth -o simplescan # success $ gcc -lbluetooth simplescan.c -o simplescan # failure / Tmp /ccWhZFXs.o: function `mainly ':. Simplescan.c: (text + 0x79): 'undefined reference to hci_get_route'. Simplescan.c: (text + 0x8c): `hci_open_dev '' '' 'undefined reference to simplescan.c :( .text + 0x132):' undefined reference to hci_inquiry '. Simplescan.c :( text + 0x18f): `undefined reference to ba2str 'simplescan.c :( text + 0x1f0):. Undefined context: error: Ld 1 exit status
Comments
Post a Comment