JL.
JL.

Reputation: 81342

Undefined references everywhere, while trying to compile BluezTools?

I'm trying to compile BluezTools using the following command:

./autogen.sh && ./configure && make

Here is a snippet of the output:

obextransfer.c:(.text+0x4d5): undefined reference to `g_type_check_instance_cast'
obextransfer.c:(.text+0x4f1): undefined reference to `dbus_g_proxy_disconnect_signal'
obextransfer.c:(.text+0x4fd): undefined reference to `g_object_unref'
obextransfer.c:(.text+0x50a): undefined reference to `g_free'
obextransfer.c:(.text+0x517): undefined reference to `g_object_unref'
obextransfer.c:(.text+0x528): undefined reference to `g_type_check_class_cast'
lib/obexd/obextransfer.o: In function `obextransfer_cancel':
obextransfer.c:(.text+0x56a): undefined reference to `g_type_check_instance_is_a'
obextransfer.c:(.text+0x58a): undefined reference to `g_assertion_message_expr'
lib/obexd/obextransfer.o: In function `obextransfer_get_dbus_object_path':
obextransfer.c:(.text+0x5e2): undefined reference to `g_type_check_instance_is_a'
obextransfer.c:(.text+0x602): undefined reference to `g_assertion_message_expr'
lib/obexd/obextransfer.o: In function `_obextransfer_get_property':
obextransfer.c:(.text+0x64f): undefined reference to `g_type_check_instance_cast'
obextransfer.c:(.text+0x660): undefined reference to `g_type_name'
obextransfer.c:(.text+0x66f): undefined reference to `g_type_name'
obextransfer.c:(.text+0x6a3): undefined reference to `g_log'
lib/obexd/obextransfer.o: In function `progress_handler':
obextransfer.c:(.text+0x4af): undefined reference to `g_signal_emit'
lib/obexd/obextransfer.o: In function `obextransfer_cancel':
obextransfer.c:(.text+0x5ad): undefined reference to `dbus_g_proxy_call'
lib/obexd/obextransfer.o: In function `obextransfer_get_dbus_object_path':
obextransfer.c:(.text+0x619): undefined reference to `dbus_g_proxy_get_path'
lib/obexd/obextransfer.o: In function `_obextransfer_get_property':
obextransfer.c:(.text+0x6e7): undefined reference to `g_value_set_string'
collect2: error: ld returned 1 exit status
make[2]: *** [bt-monitor] Error 1
make[2]: Leaving directory `/home/[]/Downloads/bluez-tools-bluez-tools/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/[]/Downloads/bluez-tools-bluez-tools

This is my first attempt as building a C project on Linux, where am I going wrong?

Running Linux Mint 15 Olivia 64bit.

Upvotes: 1

Views: 4022

Answers (2)

wanaryytel
wanaryytel

Reputation: 3492

Fixed a similar problem by adding pkg-config --libs gtk+-2.0. Maybe helps someone.

Upvotes: 0

thuovila
thuovila

Reputation: 2030

Do you have bluez and obexd installed? https://code.google.com/p/bluez-tools/#Requirements You could check the output of ./configure for any errors. Usually there is a configure.log or similar to grep for erros.

I dont know about Mint package management, but you probably need some kind of obex*-dev package at least or install obex source yourself.

EDIT Edited to answer the comment.

I do not think the obexd-client is enough, but try this method and see if it is. Otherwise you need to look for some -dev packages like libglib2.0-cil-dev libglib2.0-dev and libdbus-glib-1-dev. (Those are the names on Ubuntu).

Here is how I got it to compile (still emits warnings, though).

  1. Install a bunch of -dev packages for glib and dbus (ddg/google the functions that fail to link, so you see which libraries they are from).

  2. Execute pkg-config --libs --cflags dbus-1 dbus-glib-1 glib-2.0

  3. Use the output of the command in the ./configure e.g.: env LIBS="-I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -ldbus-glib-1 -ldbus-1 -lgobject-2.0 -lglib-2.0" ./configure

  4. Execute make

See also this question: Compilation error dbus-ping-pong

Upvotes: 3

Related Questions