
我正在努力使https://code.google.com/p/bluez-tools/。配置似乎已經找到了標頭。我安裝了 obexd-client 軟體包和 BlueZ 4.101。
這是我編譯 Linux C 應用程式的第一次實驗。
為什麼不能編譯?
obexclient_session.c:(.text+0x202): undefined reference to `g_free'
obexclient_session.c:(.text+0x20e): undefined reference to `g_object_unref'
obexclient_session.c:(.text+0x21b): undefined reference to `g_free'
obexclient_session.c:(.text+0x228): undefined reference to `g_object_unref'
obexclient_session.c:(.text+0x239): undefined reference to `g_type_check_class_cast'
答案1
你缺少圖書館。您需要確保:
您已擁有所需的程式庫
bluez
並obexd
已安裝在您的系統上。$ sudo apt-get install libbluetooth-dev libopenobex1-dev libopenobex1
筆記:可能還有其他的,但這些似乎是顯而易見的。您可以使用命令來尋找其他庫,
apt-cache search <string>
其中<string>
可以是obex
或 之類的內容bluez
。它們是所需的最低版本:bluez-4.69 和 obexd-0.30。
答案2
似乎缺少 glib(g_free、g_object_unref 等是由 glib 提供)
$ sudo apt-get install libglib2.0-dev
在類似 Debian 的系統上