Skip to content

Build fails undefined reference #2

Open
@littleboot

Description

@littleboot

Hello I'm trying to build 'lampify' but I'm unable to do so, I've tried building on Linux mint and Kali linux both fail the same way.

System info

Linux tom-mint 5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Install dependencies:

sudo apt install libbluetooth-dev libnotify-dev make gcc

Missing deps not listed in readme

git

Clone repo in downloads folder

cd ~/Downloads
git clone https://github.com/MasterDevX/lampify.git
cd lampify

Try building

make

Build fail 1

/usr/include/glib-2.0/glib/gtypes.h:32:10: fatal error: glibconfig.h: No such file or directory
   32 | #include <glibconfig.h>

Fix

Seems the missing header file is located at a different location in my system:
/usr/lib/x86_64-linux-gnu/glib-2.0/include
Fix: add the missing path to the Makefile

Build fail 2

gcc -Wall -Ofast -I /usr/include/glib-2.0 -I /usr/lib/glib-2.0/include -I /usr/include/gdk-pixbuf-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -lbluetooth -lnotify -o lampify lampify.c
/usr/bin/ld: /tmp/ccvBgzpw.o: in function `hciSetParams':
lampify.c:(.text+0x13d4): undefined reference to `hci_send_req'
/usr/bin/ld: /tmp/ccvBgzpw.o: in function `sendPacket':
lampify.c:(.text+0x1430): undefined reference to `hci_get_route'
/usr/bin/ld: lampify.c:(.text+0x143f): undefined reference to `hci_open_dev'
/usr/bin/ld: lampify.c:(.text+0x14c7): undefined reference to `hci_send_req'
/usr/bin/ld: lampify.c:(.text+0x14f3): undefined reference to `hci_send_cmd'
/usr/bin/ld: lampify.c:(.text+0x150c): undefined reference to `hci_le_set_advertise_enable'
/usr/bin/ld: lampify.c:(.text+0x152c): undefined reference to `hci_le_set_advertise_enable'
/usr/bin/ld: lampify.c:(.text+0x1537): undefined reference to `hci_close_dev'
/usr/bin/ld: /tmp/ccvBgzpw.o: in function `decodeCommand':
lampify.c:(.text+0x17e9): undefined reference to `notify_init'
/usr/bin/ld: lampify.c:(.text+0x17f5): undefined reference to `notify_notification_new'
/usr/bin/ld: lampify.c:(.text+0x1805): undefined reference to `notify_notification_set_timeout'
/usr/bin/ld: lampify.c:(.text+0x180f): undefined reference to `notify_notification_show'
collect2: error: ld returned 1 exit status
make: *** [Makefile:9: all] Error 1

I don't know how to fix this issue, it seems the hci functions are depreciated in Bluez, this might be causing the problem. I have no clue on how to fix this, I hope someone is able to help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions