|
You don't need to use sudo for configure, or make, but you do need to sudo make install - unless of course you're doing this in a directory that you don't have normal write access to - in which case Don't Do That! - maybe set up a $HOME/src directory, extract (tar xf) the source there, and configure and build (make) as non-root user.
modified 24-Mar-19 20:48pm.
|
|
|
|
|
I have a prediction : When you get to the part where you're able to make bluez, you're going to run into this:
CC gdbus/mainloop.lo
In file included from /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h:9:0,
from /usr/include/glib-2.0/glib/gtypes.h:32,
from /usr/include/glib-2.0/glib/galloca.h:32,
from /usr/include/glib-2.0/glib.h:30,
from gdbus/mainloop.c:28:
/usr/include/glib-2.0/glib/gtypes.h: In function '_GLIB_CHECKED_ADD_U64':
/usr/include/glib-2.0/glib/gmacros.h:241:53: error: size of array '_GStaticAssertCompileTimeAssertion_0' is negative
...
Makefile:5858: recipe for target 'gdbus/mainloop.lo' failed
make[1]: *** [gdbus/mainloop.lo] Error 1
Makefile:3278: recipe for target 'all' failed
make: *** [all] Error 2
When you get to that point you should realize that you need to install a cross-compiled version of glib2 to be able to cross-compile bluez.
Ditto for any prerequisites for glib2.
|
|
|
|
|
OK , this may be the last post on this subject.
To implement bluez package usable for C++ development, one starts with "configure".
This script is "automatically generated"(?) and guesses many usable options / parameters to be implemented when the bluez package is actually installed - either by make and make install or checkinstall.
I took the liberty to edit it and here is a basic , no options provided output.
sudo bash configure_edit
[sudo] password for jim:
@ line # 53 **** CONFIGURE EDIT *****
**** CONFIGURE EDIT **** checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to create a pax tar archive... gnutar
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
3716 **** CONFIGURE EDIT **** checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether make supports nested variables... (cached) yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for pkg-config... /usr/bin/pkg-config
configure_edit: *** CONFIGURE EDIT *** WARNING: using cross tools not prefixed with host triplet
checking pkg-config is at least version 0.9.0... yes
checking for C/C++ restrict keyword... __restrict
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking whether gcc accepts -fPIE... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
6586 ***CONFIGURE EDIT *** why build NAME to host FORMAT ??? checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
6643 ***CONFIGURE EDIT **** buidl name to toolchain format ??? checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
12829 ***CONFIGURE EDIT *** checking if libtool supports shared libraries... yes
12834 ***CONFIGURE EDIT *** checking whether to build shared libraries... yes
12863 ***CONFIGURE EDIT *** checking whether to build static libraries... no
checking for signalfd... yes
checking for clock_gettime in -lrt... yes
checking for pthread_create in -lpthread... yes
checking for dlopen in -ldl... yes
checking linux/types.h usability... yes
checking linux/types.h presence... yes
checking for linux/types.h... yes
checking linux/if_alg.h usability... yes
checking linux/if_alg.h presence... yes
checking for linux/if_alg.h... yes
checking for GLIB... yes
checking for DBUS... yes
checking D-Bus configuration directory... /etc
checking D-Bus system bus services dir... /usr/share/dbus-1/system-services
checking D-Bus session bus services dir... /usr/share/dbus-1/services
checking for UDEV... yes
checking for udev_hwdb_new in -ludev... yes
checking udev directory... /lib/udev
checking for ICAL... yes
checking readline/readline.h usability... yes
checking readline/readline.h presence... yes
checking for readline/readline.h... yes
checking systemd system unit dir... /lib/systemd/system
checking systemd user unit dir... /usr/lib/systemd/user
checking that generated files are newer than configure... done
configure_edit: creating ./config.status
@ line # 14959 **** CONFIGURE EDIT ***** executing config.status ?
config.status: creating Makefile
config.status: creating src/bluetoothd.8
config.status: creating lib/bluez.pc
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
jim@jim-desktop:/media/jim/DEV/BLUEZ/bluez-5.50$
I do not expect the forum to analyze the enclosed, but please note highlighted.
In my view - the "configure" found the not optioned triplet, is agreeable to build shared libraries etc.
The most important part is the LAST line - that SHOULD actually build the NOT requested libbluetooth.so file of NOT specified , correctly guessed x86 architecture.
The "configure" output looks much different when both --host and --build are optioned.
End of story.
|
|
|
|
|
Just out of curiosity, what OS are you using on the PC? Ubuntu, Debian or something else?
|
|
|
|
|
The overall work that must be getting it worked to which it will be managed by the process to get the function for it so
|
|
|
|
|
Sorry, little hard to figure out what you are trying to say.
Just for update
I am using bluez source to build a C++ library for specific (--host= arm) architecture using (--build=x86) architecture.
It supposedly works, but not for me.
I am in process of analyzing the "lead script" - configure - to find out how it should process the options. It is a slow process.
|
|
|
|
|
He's a spammer:
Hidden link spammer in QA (Member 14199368)[^]
He just forgot to add the hidden spam link to this message.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
something to consider ...
2019-03-26 11:35:24 ~/tmp $ #Starting from minimal Debian install ...
2019-03-26 11:35:41 ~/tmp $ #No compiler ...
2019-03-26 11:36:06 ~/tmp $ gcc -v
-bash: gcc: command not found
2019-03-26 11:36:24 ~/tmp $ # no cross-compiler ...
2019-03-26 11:36:35 ~/tmp $ arm-linux-gnueabihf-gcc -v
-bash: arm-linux-gnueabihf-gcc: command not found
2019-03-26 11:36:55 ~/tmp $ #lets install cross-compiler
2019-03-26 11:37:12 ~/tmp $ sudo apt install -q -y gcc-arm-linux-gnueabihf
Reading package lists...
Building dependency tree...
Reading state information...
[ ... output snipped ... ]
Setting up gcc-6-arm-linux-gnueabihf (6.3.0-18cross1) ...
Setting up gcc-arm-linux-gnueabihf (4:6.3.0-4) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
2019-03-26 11:39:53 ~/tmp $ # now we can cross-compile ...
2019-03-26 11:41:02 ~/tmp $ arm-linux-gnueabihf-gcc -Wall -Wextra hello.c -o hello_arm
2019-03-26 11:41:10 ~/tmp $ #that won't run on this system ...
2019-03-26 11:41:26 ~/tmp $ ./hello_arm
-bash: ./hello_arm: cannot execute binary file: Exec format error
2019-03-26 11:41:29 ~/tmp $ #what about the pi
2019-03-26 11:42:32 ~/tmp $ scp hello_arm pi3:
hello_arm 100% 8376 3.0MB/s 00:00<br />
2019-03-26 11:42:41 ~/tmp $ ssh pi3
Linux pi3 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l
Last login: Tue Mar 26 11:42:12 2019 from 192.168.235.51
k5054@pi3:~ $ ls
hello_arm
k5054@pi3:~ $ ./hello_arm
Hello from a pi!
k5054@pi3:~ $ logout
Connection to pi3 closed.
2019-03-26 11:42:57 ~/tmp $ #so far so good
2019-03-26 11:43:08 ~/tmp $ # now lets add armhf as foreign arch
2019-03-26 11:43:28 ~/tmp $ sudo dpkg --add-architecture armhf
2019-03-26 11:44:05 ~/tmp $ dpkg --print-foreign-architectures
armhf
2019-03-26 11:44:17 ~/tmp $ #update apt ...
2019-03-26 11:44:34 ~/tmp $ sudo apt-get -q update
[ ... output snipped ...]
Reading package lists...
2019-03-26 11:44:54 ~/tmp $ # now add libbluetooth for armhf
2019-03-26 11:45:22 ~/tmp $ sudo apt install libbluetooth-dev:armhf
Reading package lists... Done
Building dependency tree<br />
Reading state information... Done
[... output snipped ...]
Setting up libbluetooth3:armhf (5.43-2+deb9u1) ...
Setting up libbluetooth-dev:armhf (5.43-2+deb9u1) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
2019-03-26 11:45:56 ~/tmp $ #Now, lets compile that test program you posted some time back ...
2019-03-26 11:46:40 ~/tmp $ arm-linux-gnueabihf-gcc vscan.c -o vscan -lbluetooth -o vscan
2019-03-26 11:46:51 ~/tmp $ file vscan
vscan: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=6f7c63c8962a94e135b127cf3cf5033d512f6bb6, not stripped
2019-03-26 11:46:59 ~/tmp $ #that looks good ... lets test it on the pi
2019-03-26 11:47:23 ~/tmp $ scp vscan pi3:
vscan 100% 8696 3.0MB/s 00:00<br />
2019-03-26 11:47:33 ~/tmp $ ssh pi3
Linux pi3 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l
Last login: Tue Mar 26 11:42:47 2019 from 192.168.235.205
k5054@pi3:~ $ ls
hello_arm vscan
k5054@pi3:~ $ ./vscan
Basic bluetooth app BLUEZ_LINUX
k5054@pi3:~ $ logout
Connection to pi3 closed.
2019-03-26 11:48:22 ~/tmp $ # Ta Da ... total time about 15 minutes ...
2019-03-26 11:49:20 ~/tmp $
|
|
|
|
|
I did try this and it looks as the "problem " may be in Ubuntu itself.
jim@jim-desktop:~$ sudo apt install -q -y gcc-arm-linux-gnueabihf
[sudo] password for jim:
Reading package lists...
Building dependency tree...
Reading state information...
gcc-arm-linux-gnueabihf is already the newest version (4:5.3.1-1ubuntu1).
gcc-arm-linux-gnueabihf set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
jim@jim-desktop:~$ dpkg --print-foreign-architectures
i386
armhf
jim@jim-desktop:~$ sudo apt-get -q update
Hit:1 http://us.archive.ubuntu.com/ubuntu xenial InRelease
Hit:5 http://ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu xenial InRelease
Guntu.com/ubuntu xenial/restricted armhf Packages
ltiverse armhf Packages
Err:10 http://us.archive.ubuntu.com/ubuntu xenial/main armhf Packages
404 Not Found [IP: 91.189.91.23 80]
http://us.archive.ubuntu.com/ubuntu xenial-backports/universe armhf Packages
Ign:28 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe armhf Packages
Ign:34 http://us.archive.ubuntu.com/ubuntu xenial-updates/multiverse armhf Packages
Err:18 http://us.archive.ubuntu.com/ubuntu xenial-updates/main armhf Packages
404 Not Found [IP: 91.189.91.23 80]
Ign:24 http://us.archive.ubuntu.com/ubuntu xenial-updates/restricted armhf Packages
Get:41 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [626 kB]
Ign:37 http://us.archive.ubuntu.com/ubuntu xenial-backports/main armhf Packages
Err:37 http://us.archive.ubuntu.com/ubuntu xenial-backports/main armhf Packages
404 Not Found [IP: 91.189.91.23 80]
Ign:39 http://us.archive.ubuntu.com/ubuntu xenial-backports/universe armhf Packages
Get:46 http://security.ubuntu.com/ubuntu xenial-security/main DEP-11 64x64 Icons [64.6 kB]
Ign:47 http://security.ubuntu.com/ubuntu xenial-security/restricted armhf Packages
Err:43 http://security.ubuntu.com/ubuntu xenial-security/main armhf Packages
404 Not Found [IP: 91.189.88.152 80]
Ign:47 http://security.ubuntu.com/ubuntu xenial-security/restricted armhf Packages
Ign:50 http://security.ubuntu.com/ubuntu xenial-security/universe armhf Packages
Ign:54 http://security.ubuntu.com/ubuntu xenial-security/multiverse armhf Packages
Fetched 325 kB in 3s (81.9 kB/s)
Reading package lists...
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial/main/binary-armhf/Packages 404 Not Found [IP: 91.189.91.23 80]
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-armhf/Packages 404 Not Found [IP: 91.189.91.23 80]
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial-backports/main/binary-armhf/Packages 404 Not Found [IP: 91.189.91.23 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/main/binary-armhf/Packages 404 Not Found [IP: 91.189.88.152 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
jim@jim-desktop:~$ sudo apt install libbluetooth-dev:armhf
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libbluetooth-dev:armhf
jim@jim-desktop:~$
|
|
|
|
|
You can fix that by editing /etc/apt/sources.list and changing all the lines that start
deb http://... to
deb [arch=amd64,i386] http://...
and add the ubuntu ports repo
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports bionic main universe
However, that doesn't help a lot - then you get:
sudo apt-get install libbluetooth-dev:armhf
Reading package lists... Done
Building dependency tree<br />
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help resolve the situation:
The following packages have unmet dependencies:
libbluetooth-dev:armhf : Depends: libbluetooth3:armhf (= 5.48-0ubuntu3) but it is not going to be installed
Depends: libc6-dev:armhf but it is not going to be installed or
libc-dev:armhf
E: Unable to correct problems, you have held broken packages.
I tried following along by adding all the dependencies manually e.g.
$sudo apt-get libbluetooth-dev:armhf libbluetooth3:armhf libc6-dev:armhf thinking I'd eventually get all the dependencies were added, but then you get to gcc-8-base:armhf and you get this
$ sudo apt-get install gcc-8-base:armhf
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
amd64-microcode gcc-7-arm-linux-gnueabihf-base gcc-7-cross-base
gcc-8-cross-base libasan4-armhf-cross libatomic1-armhf-cross
libc6-armhf-cross libc6-dev-armhf-cross libcilkrts5-armhf-cross
libgcc-7-dev-armhf-cross libgcc1-armhf-cross libgomp1-armhf-cross
libstdc++6-armhf-cross libubsan0-armhf-cross linux-libc-dev
linux-libc-dev-armhf-cross m17n-db manpages-dev ncurses-term vim-gui-common
vim-runtime
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
accountsservice acl acpi-support acpid adduser adwaita-icon-theme aisleriot
alsa-base alsa-utils anacron apg apparmor apport apport-gtk appstream apt
[ ... about 300 lines removed ...]
xserver-xorg-video-vesa xserver-xorg-video-vmware xul-ext-ubufox xwayland
xxd xz-utils yelp zeitgeist-core zenity zip zlib1g
The following NEW packages will be installed:
gcc-8-base:armhf
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
apt adduser (due to apt) gpgv (due to apt) libapt-pkg5.0 (due to apt)
libc6 (due to apt) libgcc1 (due to apt) libgnutls30 (due to apt)
[ .. more lines removed ...]
0 upgraded, 1 newly installed, 1421 to remove and 0 not upgraded.
Need to get 18.2 kB of archives.
After this operation, 3,343 MB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
?] no
Abort.
$ apt list --installed 2>/dev/null | wc -l
1648
$ So that's not the way to go, either. There seems to be something broken with Ubuntu's foreign-arch handling.
Debian and Ubuntu are very close, so maybe you could switch to Debian for your PC rather than Ubuntu - otherwise, you could try installing virtualbox or VmWare, and install Debian as a guest OS. Guest OS's run only very slightly slower than the host. For example, it took about 4 minutes to compile the source code for postgresql-11.1 on my host, and about 4:30 on the guest. Not much in it, and eclipse is available for Debian, so you should be at home. If you run your host in full-screen mode, you'd hardly be aware you're not running the OS natively on the PC.
modified 26-Mar-19 17:49pm.
|
|
|
|
|
Thanks, you are being very hel[full.
Hope you are not spend too much time on this problem.
But I do appreciate the help.
you could try installing virtualbox or VmWare, and install Debian as a guest OS. Guest OS's run only very slightly slower
I had a very bad experience "upgrading" to Ubuntu 18 , so I do prefer not to mess with my OS.
If I do the above will be be easy to switch between Ubuntu / Debian?
Of course I may have an issue re-installing Eclipse, especially moving current stuff over...
|
|
|
|
|
I got "virtualbox" loaded , but after selecting Debian as OS I get "no bootable medium...process halted ". It actually asked for "optical disk" to use as boot (?)
I'll try different "virtual disk" next try.
|
|
|
|
|
|
I used wget....maybe I should do it over.
|
|
|
|
|
$ file debian-9.8.0-amd64-netinst.iso
debian-9.8.0-amd64-netinst.iso: ISO 9660 CD-ROM filesystem data (DOS/MBR boot sector) 'Debian 9.8.0 amd64 n' (bootable)
$ md5sum debian-9.8.0-amd64-netinst.iso
e0a43cbb8b991735c1b38e7041019658 debian-9.8.0-amd64-netinst.iso
In VitrualBox Manager, select your guest image, settings -> storage. Select Controler IDE, then the ()Empty slot. The right pane should show Optical Drive : [IDE Secondary Master v]. CLick on the icon next to that. If the iso image is in the drop-down, select it, otherwise select [Choose Virtual Optical Drive ...] navigate to your iso image and select. Under storage tree -> Controller:IDE it should now show "debian-9.8.0 amd64-netinst.iso"
Boot and install .... hopefully
Couple of things ...
If you want to ssh into the guest from the host, change the Network Adapter from NAT to Bridged or Host only (see the help file for the difference). In either case you'll need to either have a DHCP server or configure the IP manually.
By default the disk size is 8GB - that's barely big enough to install Debian with a GUI. You should probably have at least 16GB of drive space.
modified 27-Mar-19 12:36pm.
|
|
|
|
|
When I use the icon it wants ...optical disk FILE
|
|
|
|
|
This is part of README file included in BlueZ.
Here is a part I am not sure about.
Could somebody please translate this techno-talk to plain English (talk ) ?
For a working system, certain configuration options need to be enabled:
Of course I want working system
--enable-library
Enable installation of Bluetooth library
What is the name of this library and where is it going to be installed ?
Installed by configure itself or make / make install?
By default the Bluetooth library is no longer installed.
The user interfaces or command line utilities do not
require an installed Bluetooth library anymore. This
option is provided for legacy third party applications
that still depend on the library.
When the library installation is enabled, it is a good
idea to use a separate bluez-library or libbluetooth
package for it.
Any suggestion HOW to do the above highlighted text ?
Build a NEW packages??
|
|
|
|
|
You'll probably get better results if you direct your questions to the bluez user mailing list. While people here can answer questions of a general nature, specific questions relating to a specific package are, I think, outside of the intended scope of this forum. That doesn't mean that someone with related experience won't respond just because its out of scope (though that might be the case), but those with the information you seek are more likely to be in the user-group/mailing lists for that package.
|
|
|
|
|
I agree with k5054, and have already suggested you go to the Bluez site. While I have a reasonable knowledge of Linux, configurable packages, compiling and linking etc., all your questions are specific to Bluez. And I (and I guess k5054) have no experience of this package or how it is put together.
|
|
|
|
|
I guess .NET does some things better than Linux.
Had Windows 10 talking to a Lego "brick" (EV3) using Bluetooth, USB and TCP/IP in less than an hour.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
This is a linker question.
Could somebody help me to decode this linker verbose output to find WHERE is the " linked to" option actually located.
Building target: BLUE2_LINUX_19381
Invoking: GCC C++ Linker
g++ -v -o "BLUE2_LINUX_19381" ./src/BLUE.o -lbluetooth
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.11' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.11)
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'BLUE2_LINUX_19381' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccFV22zV.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o BLUE2_LINUX_19381 /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. ./src/BLUE.o -lbluetooth -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o
Finished building target: BLUE2_LINUX_19381
08:15:26 Build Finished. 0 errors, 1 warnings. (took 2s.946ms)
I did try this and cannot find it:
jim@jim-desktop:~$ sudo find /usr -type f -name "bluetooth.*"
[sudo] password for jim:
/usr/share/help-langpack/en_GB/ubuntu-help/bluetooth.page
/usr/share/help-langpack/cs/ubuntu-help/bluetooth.page
/usr/share/help-langpack/cs/gnome-help/bluetooth.page
/usr/share/help-langpack/en_AU/ubuntu-help/bluetooth.page
/usr/share/help-langpack/en_CA/ubuntu-help/bluetooth.page
/usr/share/man/man1/bluetooth.1.gz
/usr/share/icons/Humanity/apps/22/bluetooth.svg
/usr/share/icons/Humanity/apps/48/bluetooth.svg
/usr/share/icons/Humanity/apps/24/bluetooth.svg
/usr/share/icons/HighContrast/48x48/apps/bluetooth.png
/usr/share/icons/HighContrast/16x16/apps/bluetooth.png
/usr/share/icons/HighContrast/22x22/apps/bluetooth.png
/usr/share/icons/HighContrast/24x24/apps/bluetooth.png
/usr/share/icons/HighContrast/32x32/apps/bluetooth.png
/usr/share/icons/HighContrast/256x256/apps/bluetooth.png
/usr/share/app-install/icons/bluetooth.svg
/usr/share/help/C/ubuntu-help/bluetooth.page
/usr/share/help/C/gnome-help/bluetooth.page
/usr/share/plainbox-provider-checkbox/jobs/bluetooth.txt.in
/usr/include/bluetooth/bluetooth.h
/usr/src/linux-headers-4.15.0-45/include/net/bluetooth/bluetooth.h
/usr/src/linux-headers-4.15.0-46/include/net/bluetooth/bluetooth.h
jim@jim-desktop:~$ sudo find /usr -type f -name "bluetooth.a"
jim@jim-desktop:~$
I am trying to figure out how BlueZ is actually used , so I did purge Bluez.
There is no package "Bluez".
Before that I fully configured Bluez - and I added enable-library to the configuration.
I did not even run make make install and tested my app and it run with the -lbluetooth linker option.
It appears the "bluetooth" library was build by running BlueZ -> configure and "purge Bluez" won't delete it.
I like to prove this by deleting it manually, but need to know where it is.
There is no package "Bluez".
But my test app still compiles / links and runs.
Thanks
|
|
|
|
|
Not sure exactly what your question is, but "make clean" should purge all the generated objects. To be honest you may get better answers at The BlueZ website[^]; that's where the knowledge is likely to be.
This is the key:
g++ -v -o "BLUE2_LINUX_19381" ./src/BLUE.o -lbluetooth
A pre-linker is creating a new library object called BLUE2_LINUX_19381 , which you can see later being included in the main link process.
|
|
|
|
|
Richard,
that is my base site , however, I have not figured out if there is a "forum" for geeks like me.
All I see is "developers" access.
I'll try it again.
|
|
|
|
|
On the contact page there's link to the mailing list in the "community for the end users" section.
|
|
|
|
|
As has been explained before, -lbluetooth tells the linker to look for a library file named either libbluetooth.so or libbluetooth.a. Your find doesn't find it because -name option uses standard file globbing so -name "bluetooth.*" wont find any files that look like .../libbluetooth.a . You need to use -name "libbluetooth.*" , or -name "*bluetooth.*"
I think you said you had built and installed bluez from source. Unless you changed the installation location, it probably put the libraries under /usr/local. When you purged bluez (I'm assuming you mean the command apt-get delete --purge bluez ), that will only remove the packages installed by apt. Any packages you built and installed yourself will not be touched (unless you deliberately configured the package to overwrite the system packages).
|
|
|
|