编译-bluez-utils-3.36报错

配置信息①:

./configure --prefix=/opt/arm/bluez --host=arm-linux --target=arm-linux CC="arm-linux-gcc -I/opt/arm/bluez/include -L/opt/arm/bluez/lib"  

报错①:

make  all-am
make[3]: Entering directory `/home/bluetooth/bluez-utils-3.36/hcid'
/bin/bash ../libtool --tag=CC   --mode=link arm-linux-gcc -I/opt/arm/bluez/include -L/opt/arm/bluez/lib -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include   -pthread -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include   -I../gdbus -DPLUGINDIR=\""/opt/arm/bluez/lib/bluetooth/plugins"\" -Wall -O2 -D_FORTIFY_SOURCE=2 -fPIE  -pie -o hcid main.o libhciserver.a ../sdpd/libsdpserver.a ../common/libhelper.a ../gdbus/libgdbus.la -Wl,--export-dynamic -pthread -L/usr/local/lib -lgmodule-2.0 -lrt -lglib-2.0   -L/usr/local/lib -lglib-2.0   -ldbus-1 -lpthread -lrt   -lbluetooth   
arm-linux-gcc -I/opt/arm/bluez/include -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -pthread -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I../gdbus -DPLUGINDIR=\"/opt/arm/bluez/lib/bluetooth/plugins\" -Wall -O2 -D_FORTIFY_SOURCE=2 -fPIE -pie -o hcid main.o -Wl,--export-dynamic -pthread  -L/opt/arm/bluez/lib libhciserver.a ../sdpd/libsdpserver.a ../common/libhelper.a ../gdbus/.libs/libgdbus.a -L/usr/local/lib /opt/arm/bluez/lib/libgmodule-2.0.so -ldl /opt/arm/bluez/lib/libglib-2.0.so /opt/arm/bluez/lib/libdbus-1.so -lpthread -lrt /opt/arm/bluez/lib/libbluetooth.so   -Wl,--rpath -Wl,/opt/arm/bluez/lib -Wl,--rpath -Wl,/opt/arm/bluez/lib
/usr/local/arm/4.4.1/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/bin/ld: warning: library search path "/usr/local/lib" is unsafe for cross-compilation
main.o: In function `init_all_devices':
main.c:(.text+0xe24): undefined reference to `g_try_malloc0'
libhciserver.a(device.o): In function `disconnect':
device.c:(.text+0x870): undefined reference to `g_timeout_add_seconds'
libhciserver.a(device.o): In function `device_create':
device.c:(.text+0xb48): undefined reference to `g_try_malloc0'
libhciserver.a(device.o): In function `get_properties':
device.c:(.text+0x14c0): undefined reference to `g_malloc0_n'
libhciserver.a(device.o): In function `browse_cb':
device.c:(.text+0x1bfc): undefined reference to `g_malloc0_n'
libhciserver.a(plugin.o): In function `plugin_init':
plugin.c:(.text+0x25c): undefined reference to `g_try_malloc0'
libhciserver.a(dbus-service.o): In function `list_trusted':
dbus-service.c:(.text+0x3c0): undefined reference to `g_malloc_n'
libhciserver.a(dbus-service.o): In function `register_service':
dbus-service.c:(.text+0x93c): undefined reference to `g_try_malloc0'
dbus-service.c:(.text+0xa4c): undefined reference to `g_malloc0_n'
libhciserver.a(dbus-service.o): In function `service_req_auth':
dbus-service.c:(.text+0xf88): undefined reference to `g_try_malloc0'
libhciserver.a(dbus-hci.o): In function `hcid_dbus_register_device':
dbus-hci.c:(.text+0x107c): undefined reference to `g_try_malloc0'
libhciserver.a(dbus-sdp.o): In function `remote_svc_identifiers_completed_cb':
dbus-sdp.c:(.text+0xa30): undefined reference to `g_malloc_n'
libhciserver.a(adapter.o): In function `adapter_list_trusts':
adapter.c:(.text+0x4d4): undefined reference to `g_malloc_n'
../common/libhelper.a(glib-helper.o): In function `bt_io_create':
glib-helper.c:(.text+0x20c): undefined reference to `g_try_malloc0'
glib-helper.c:(.text+0x268): undefined reference to `g_try_malloc0'
glib-helper.c:(.text+0x2bc): undefined reference to `g_try_malloc0'
../common/libhelper.a(glib-helper.o): In function `bt_uuid2string':
glib-helper.c:(.text+0x1640): undefined reference to `g_try_malloc0'
../common/libhelper.a(glib-helper.o): In function `bt_search_service':
glib-helper.c:(.text+0x180c): undefined reference to `g_try_malloc0'
collect2: ld returned 1 exit status
make[3]: *** [hcid] Error 1
make[3]: Leaving directory `/home/bluetooth/bluez-utils-3.36/hcid'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/bluetooth/bluez-utils-3.36/hcid'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/bluetooth/bluez-utils-3.36'
make: *** [all] Error 2
root@ubuntu:/home/bluetooth/bluez-utils-3.36# 

配置信息②:

./configure --prefix=/opt/arm/bluez --host=arm-linux --target=arm-linux CC="arm-linux-gcc -I/opt/arm/bluez/include -L/opt/arm/bluez/lib" GLIB_CFLAGS=/opt/arm/bluez/lib

报错②:

Making all in gdbus
make[2]: Entering directory `/home/bluetooth/bluez-utils-3.36/gdbus'
/bin/bash ../libtool --tag=CC   --mode=compile arm-linux-gcc -I/opt/arm/bluez/include -L/opt/arm/bluez/lib -DHAVE_CONFIG_H -I. -I..    -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include   /opt/arm/bluez/lib -Wall -O2 -D_FORTIFY_SOURCE=2 -fPIE -MT mainloop.lo -MD -MP -MF .deps/mainloop.Tpo -c -o mainloop.lo mainloop.c
mkdir .libs
 arm-linux-gcc -I/opt/arm/bluez/include -L/opt/arm/bluez/lib -DHAVE_CONFIG_H -I. -I.. -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include /opt/arm/bluez/lib -Wall -O2 -D_FORTIFY_SOURCE=2 -fPIE -MT mainloop.lo -MD -MP -MF .deps/mainloop.Tpo -c mainloop.c  -fPIC -DPIC -o .libs/mainloop.o
cc1: warning: include location "/usr/include/dbus-1.0" is unsafe for cross-compilation
mainloop.c:30: fatal error: glib.h: No such file or directory
compilation terminated.
make[2]: *** [mainloop.lo] Error 1
make[2]: Leaving directory `/home/bluetooth/bluez-utils-3.36/gdbus'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/bluetooth/bluez-utils-3.36'
make: *** [all] Error 2
root@ubuntu:/home/bluetooth/bluez-utils-3.36# 

猜你喜欢

转载自blog.csdn.net/weixin_38184741/article/details/80200067