Adding "blueZ" library - linker options where ?
-
I have decided to try using plain "blueZ" library.
I have added necessary #include to my common header.Now need some help with the following
- I have "include" headers in .pro
bluez/lib/bluetooth.h \ bluez/lib/hci.h \ bluez/lib/hci_lib.h
- I also have #include in my common header
// NOTE fixed path #include </media/f/QT/QT_PROJECT/CAT_V1/bluez/lib/bluetooth.h> #include </media/f/QT/QT_PROJECT/CAT_V1/bluez/lib/hci.h> #include </media/f/QT/QT_PROJECT/CAT_V1/bluez/lib/hci_lib.h>
Which is proper way to #include these "external file" headers in QtCreator project?
I like to have "variable path" - I keep my versions by changing the "CAT_Vx" part which is currently fixed to "CAT_V1".I have no idea how to add "libbluetooth" AKA -lbluetooth to / where in QtCreator .
I am using GCC so I need to add "-lbluetooth" to linker options.Where do I add it?
To compile our program, invoke gcc and link against libbluetooth # gcc -o simplescan simplescan.c -lbluetooth
-
If you have a grub issue then you have a system issue that is unrelated to Qt nor programming so there's indeed something messed up with your computer.
-
See the LIBS command
-
Hi,
To add to @Christian-Ehrlicher: look at the qmake documentation.
-
I found this to add to .pro
LIBS += -lbluetooth
now I need to add path
-
@AnneRanch said in Adding "blueZ" library - linker options where ?:
now I need to add path
And what hinders you to add it?
-
@Christian-Ehrlicher said in Adding "blueZ" library - linker options where ?:
@AnneRanch said in Adding "blueZ" library - linker options where ?:
now I need to add path
And what hinders you to add it?
I cannot "search for "bluetooth" file using "find . -name "bluetooth" I am getting folders , not a file.
-
@AnneRanch
Hi
The syntax is like
LIBS += -L/usr/local/lib -lmath
so with big -L we can give the path and with little -l we give the library name.I assume that is what you mean by adding path ?
-
"I am sooo confused..."
Should
sudo apt-get install libbluetooth-dev
install , by default, into/usr/include/bluetooth ??
How do I get "bluetooth" out of
libbluetooth-dev ?
doesn't GCC works with "static" or "shared" library as oppose of Windows "DLL" ?
And how does .pro
QT bluetooth
fits into scheme of things?
-
@AnneRanch said in Adding "blueZ" library - linker options where ?:
libbluetooth-dev
This installs the include files, not the lib itself, so it has no relation to -L.
You need libbluetooth to get the lib and in that package you can see where the lib is installed.
Using the packages of your distribution there is no need to use -L as the lib will be installed in standard libs location. -
@jsulm
Sorry , but my problem is in OS itself - it refuses to install libbluetooth-dev for so far unknown reason.Please put this thread on hold until I fix that.
BTW one can install library using menu in .pro file, of course one has to know from where and what. Duh.
Then the -L/-l options are handled by QtCreator itself. -
Since you installed that library through the package manager, the paths shall already be good and you just have to link to the appropriate library.
Since you are on Linux you can also take advantage of pkg-config and use:
CONFIG += link_pkgconfig PKGCONFIG += bluez
-
@AnneRanch said in Adding "blueZ" library - linker options where ?:
Sorry , but my problem is in OS itself - it refuses to install libbluetooth-dev for so far unknown reason.
What exact error do you get ?
-
@SGaist I am not sure I want to discuss it here in public. Is is rather complex , but if you re interested - is there away I can send it to you private or do you want the link to the "Linux" forum? That wold save me time.
Basically some issue with "grub" unable to "update / upgrade" and consequently "install" also fails. Pretty messy. -
If you have a grub issue then you have a system issue that is unrelated to Qt nor programming so there's indeed something messed up with your computer.