我正在使用BlueZ库来使用C开发基于蓝牙的Linux应用程序。我试图将libbluetooth-dev链接到我的C文件,但它无法正常工作。
/usr/bin/ld: cannot find -libbluetooth-dev
collect2: error: ld returned 1 exit status
我的项目目录是bluez-5.45,我试图从这个文件夹构建项目并在我的主文件夹中添加我的.C文件
我安装了libbluetooth-dev库并尝试了链接但不能这样做。链接命令:gcc -o output myfile.c -libbluetooth
请让我知道我做的错误。
暗示“lib”,因此链接“bluetooth”而不是“libbluetooth”:
$ gcc -o output myfile.c -lbluetooth