Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to make gkk on RPi w. Stretch and bluez 5.50 #10

Closed
krimp opened this issue Nov 15, 2018 · 6 comments
Closed

unable to make gkk on RPi w. Stretch and bluez 5.50 #10

krimp opened this issue Nov 15, 2018 · 6 comments

Comments

@krimp
Copy link

krimp commented Nov 15, 2018

I have all the latest (as pr 15-nov-2018) dis-upgrades and updates on an RPi3 w. Stretch and have installed Bluez-5.50. The make of gkk gives the output shown below.
Any help would be appreciated.

make all-recursive
make[1]: Entering directory '/home/pi/gobbledegook'
Making all in src
make[2]: Entering directory '/home/pi/gobbledegook/src'
g++ -fPIC -Wall -Wextra -std=c++11 -g -O2 -o standalone standalone-standalone.o libggk.a -lgobject-2.0 -lgio-2.0 -lglib-2.0 -lpthread
libggk.a(libggk_a-DBusObject.o): In function ggk::DBusObject::generateIntrospectionXML(int) const': /home/pi/gobbledegook/src/DBusObject.cpp:258: undefined reference to ggk::Logger::debug(std::string const&)'
libggk.a(libggk_a-DBusObject.o): In function construct<ggk::GattService, ggk::DBusObject&, char const (&)[23]>': /usr/include/c++/4.9/ext/new_allocator.h:120: undefined reference to ggk::GattService::GattService(ggk::DBusObject&, std::string const&)'
libggk.a(libggk_a-DBusObject.o): In function ggk::GattService& ggk::GattInterface::addProperty<ggk::GattService>(std::string const&, ggk::GattUuid const&, _GVariant* (*)(_GDBusConnection*, char const*, char const*, char const*, char const*, _GError**, void*), int (*)(_GDBusConnection*, char const*, char const*, char const*, char const*, _GVariant*, _GError**, void*))': /home/pi/gobbledegook/src/GattInterface.h:100: undefined reference to ggk::GattProperty::GattProperty(std::string const&, _GVariant*, _GVariant* ()(_GDBusConnection, char const*, char const*, char const*, char const*, _GError**, void*), int ()(_GDBusConnection, char const*, char const*, char const*, char const*, _GVariant*, _GError**, void*))'
libggk.a(libggk_a-DBusObject.o): In function ggk::GattService& ggk::GattInterface::addProperty<ggk::GattService>(std::string const&, bool, _GVariant* (*)(_GDBusConnection*, char const*, char const*, char const*, char const*, _GError**, void*), int (*)(_GDBusConnection*, char const*, char const*, char const*, char const*, _GVariant*, _GError**, void*))': /home/pi/gobbledegook/src/GattInterface.h:142: undefined reference to ggk::GattProperty::GattProperty(std::string const&, _GVariant*, _GVariant* ()(_GDBusConnection, char const*, char const*, char const*, char const*, _GError**, void*), int ()(_GDBusConnection, char const*, char const*, char const*, char const*, _GVariant*, _GError**, void*))'
libggk.a(libggk_a-DBusObject.o):(.data.rel.ro._ZTVN3ggk11GattServiceE[_ZTVN3ggk11GattServiceE]+0x1c): undefined reference to ggk::GattInterface::generateIntrospectionXML(int) const' libggk.a(libggk_a-Init.o): In function ggk::registerObjects()':
/home/pi/gobbledegook/src/Init.cpp:642: undefined reference to ggk::DBusObject::generateIntrospectionXML[abi:cxx11](int) const' libggk.a(libggk_a-Server.o): In function ggk::Server::findInterface(ggk::DBusObjectPath const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) const':
/home/pi/gobbledegook/src/Server.cpp:607: undefined reference to ggk::DBusObject::findInterface(ggk::DBusObjectPath const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ggk::DBusObjectPath const&) const' libggk.a(libggk_a-Server.o): In function ggk::Server::callMethod(ggk::DBusObjectPath const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, _GDBusConnection*, _GVariant*, _GDBusMethodInvocation*, void*) const':
/home/pi/gobbledegook/src/Server.cpp:624: undefined reference to ggk::DBusObject::callMethod(ggk::DBusObjectPath const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, _GDBusConnection*, _GVariant*, _GDBusMethodInvocation*, void*, ggk::DBusObjectPath const&) const' libggk.a(libggk_a-Server.o): In function ggk::Server::Server(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, void const* ()(char const), int ()(char const, void const*))':
/home/pi/gobbledegook/src/Server.cpp:263: undefined reference to ggk::DBusObject::gattServiceBegin(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ggk::GattUuid const&)' /home/pi/gobbledegook/src/Server.cpp:303: undefined reference to ggk::DBusObject::gattServiceBegin(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, ggk::GattUuid const&)'
/home/pi/gobbledegook/src/Server.cpp:344: undefined reference to ggk::DBusObject::gattServiceBegin(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ggk::GattUuid const&)' /home/pi/gobbledegook/src/Server.cpp:385: undefined reference to ggk::DBusObject::gattServiceBegin(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, ggk::GattUuid const&)'
/home/pi/gobbledegook/src/Server.cpp:444: undefined reference to ggk::DBusObject::gattServiceBegin(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ggk::GattUuid const&)' libggk.a(libggk_a-Server.o):/home/pi/gobbledegook/src/Server.cpp:483: more undefined references to ggk::DBusObject::gattServiceBegin(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, ggk::GattUuid const&)' follow
libggk.a(libggk_a-Server.o): In function void __gnu_cxx::new_allocator<ggk::DBusInterface>::construct<ggk::DBusInterface, ggk::DBusObject&, char const (&) [35]>(ggk::DBusInterface*, ggk::DBusObject&, char const (&) [35])': /usr/include/c++/6/ext/new_allocator.h:120: undefined reference to ggk::DBusInterface::DBusInterface(ggk::DBusObject&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
libggk.a(libggk_a-Server.o): In function ggk::Server::Server(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, void const* (*)(char const*), int (*)(char const*, void const*))': /home/pi/gobbledegook/src/Server.cpp:593: undefined reference to ggk::DBusInterface::addMethod(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, char const**, char const*, void ()(ggk::DBusInterface const&, _GDBusConnection, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, _GVariant*, _GDBusMethodInvocation*, void*))'
libggk.a(libggk_a-ServerUtils.o): In function ggk::addManagedObjectsNode(ggk::DBusObject const&, ggk::DBusObjectPath const&, _GVariantBuilder*)': /home/pi/gobbledegook/src/ServerUtils.cpp:76: undefined reference to ggk::DBusObject::getInterfacesabi:cxx11 const'
/home/pi/gobbledegook/src/ServerUtils.cpp:82: undefined reference to ggk::DBusObject::getInterfaces[abi:cxx11]() const' /home/pi/gobbledegook/src/ServerUtils.cpp:90: undefined reference to ggk::DBusInterface::getNameabi:cxx11 const'
/home/pi/gobbledegook/src/ServerUtils.cpp:109: undefined reference to ggk::DBusInterface::getName[abi:cxx11]() const' /home/pi/gobbledegook/src/ServerUtils.cpp:186: undefined reference to ggk::DBusObject::getChildrenabi:cxx11 const'
/home/pi/gobbledegook/src/ServerUtils.cpp:118: undefined reference to ggk::DBusInterface::getName[abi:cxx11]() const' /home/pi/gobbledegook/src/ServerUtils.cpp:137: undefined reference to ggk::DBusInterface::getNameabi:cxx11 const'
/home/pi/gobbledegook/src/ServerUtils.cpp:146: undefined reference to ggk::DBusInterface::getName[abi:cxx11]() const' /home/pi/gobbledegook/src/ServerUtils.cpp:165: undefined reference to ggk::DBusInterface::getNameabi:cxx11 const'
libggk.a(libggk_a-GattCharacteristic.o): In function ggk::GattCharacteristic::onReadValue(void (*)(ggk::GattCharacteristic const&, _GDBusConnection*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, _GVariant*, _GDBusMethodInvocation*, void*))': /home/pi/gobbledegook/src/GattCharacteristic.cpp:115: undefined reference to ggk::DBusInterface::addMethod(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, char const**, char const*, void ()(ggk::DBusInterface const&, _GDBusConnection, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, _GVariant*, _GDBusMethodInvocation*, void*))'
libggk.a(libggk_a-GattCharacteristic.o): In function ggk::GattCharacteristic::onWriteValue(void (*)(ggk::GattCharacteristic const&, _GDBusConnection*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, _GVariant*, _GDBusMethodInvocation*, void*))': /home/pi/gobbledegook/src/GattCharacteristic.cpp:131: undefined reference to ggk::DBusInterface::addMethod(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, char const**, char const*, void ()(ggk::DBusInterface const&, _GDBusConnection, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, _GVariant*, _GDBusMethodInvocation*, void*))'
libggk.a(libggk_a-GattCharacteristic.o): In function ggk::GattCharacteristic::sendChangeNotificationVariant(_GDBusConnection*, _GVariant*) const': /home/pi/gobbledegook/src/GattCharacteristic.cpp:221: undefined reference to ggk::DBusObject::emitSignal(_GDBusConnection*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, _GVariant*)'
libggk.a(libggk_a-GattCharacteristic.o): In function ggk::GattCharacteristic::callMethod(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, _GDBusConnection*, _GVariant*, _GDBusMethodInvocation*, void*) const': /home/pi/gobbledegook/src/GattCharacteristic.cpp:74: undefined reference to ggk::DBusInterface::getNameabi:cxx11 const'
libggk.a(libggk_a-GattDescriptor.o): In function ggk::GattDescriptor::onReadValue(void (*)(ggk::GattDescriptor const&, _GDBusConnection*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, _GVariant*, _GDBusMethodInvocation*, void*))': /home/pi/gobbledegook/src/GattDescriptor.cpp:116: undefined reference to ggk::DBusInterface::addMethod(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, char const**, char const*, void ()(ggk::DBusInterface const&, _GDBusConnection, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, _GVariant*, _GDBusMethodInvocation*, void*))'
libggk.a(libggk_a-GattDescriptor.o): In function ggk::GattDescriptor::onWriteValue(void (*)(ggk::GattDescriptor const&, _GDBusConnection*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, _GVariant*, _GDBusMethodInvocation*, void*))': /home/pi/gobbledegook/src/GattDescriptor.cpp:132: undefined reference to ggk::DBusInterface::addMethod(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, char const**, char const*, void ()(ggk::DBusInterface const&, _GDBusConnection, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, _GVariant*, _GDBusMethodInvocation*, void*))'
libggk.a(libggk_a-GattDescriptor.o): In function ggk::GattDescriptor::callMethod(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, _GDBusConnection*, _GVariant*, _GDBusMethodInvocation*, void*) const': /home/pi/gobbledegook/src/GattDescriptor.cpp:75: undefined reference to ggk::DBusInterface::getNameabi:cxx11 const'
libggk.a(libggk_a-GattInterface.o): In function ggk::GattInterface::GattInterface(ggk::DBusObject&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': /home/pi/gobbledegook/src/GattInterface.cpp:45: undefined reference to ggk::DBusInterface::DBusInterface(ggk::DBusObject&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
libggk.a(libggk_a-GattInterface.o): In function ggk::GattInterface::generateIntrospectionXML[abi:cxx11](int) const': /home/pi/gobbledegook/src/GattInterface.cpp:107: undefined reference to ggk::DBusInterface::getNameabi:cxx11 const'
/home/pi/gobbledegook/src/GattInterface.cpp:112: undefined reference to ggk::DBusMethod::generateIntrospectionXML[abi:cxx11](int) const' /home/pi/gobbledegook/src/GattInterface.cpp:103: undefined reference to ggk::DBusInterface::getNameabi:cxx11 const'
libggk.a(libggk_a-GattInterface.o):(.data.rel.ro+0x20): undefined reference to `ggk::DBusInterface::callMethod(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, _GDBusConnection*, _GVariant*, _GDBusMethodInvocation*, void*) const'
collect2: error: ld returned 1 exit status
Makefile:394: recipe for target 'standalone' failed
make[2]: *** [standalone] Error 1
make[2]: Leaving directory '/home/pi/gobbledegook/src'
Makefile:368: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/pi/gobbledegook'
Makefile:309: recipe for target 'all' failed
make: *** [all] Error 2

@nettlep
Copy link
Owner

nettlep commented Nov 16, 2018

Is this a build of the code straight from GitHub, or has it been modified in any way?

The errors don't add up. I'm seeing an error in which ggk::registerObjects() is unable to find ggk::DBusObject::generateIntrospectionXML, but earlier in the log it says ggk::DBusObject::generateIntrospectionXML is unable to find a Logger. So clearly that introspection method it is present.

This tells me it's a bit deeper than what it appears. A clue is that one of those mentions of generateIntrospectionXML are actually:

ggk::DBusObject::generateIntrospectionXML(int)
and
ggk::DBusObject::generateIntrospectionXML[abi:cxx11](int)

To the compiler, those are two different functions. I'd never seen that [abi:cxx11] mangling before, so I did some digging which led to GCC's dual ABI support in gcc 5.1. From what I understand, this shouldn't impact you since you're building the library and the application with the same version of gcc. However, this sentence struck a note:

This discovered an issue when building software using the new C++ ABI with clang, which builds against the new ABI (as instructed in the GCC header file), but does not know about the abi_tag attribute. This results in problems such as (for example) any function in a library with a std::string return type will be mangled with a [abi:cxx11] ABI tag.

...which looks like a very good description of the problem you're seeing. Are you somehow mixing gcc/clang on your installation? Possibly with symlinks in /usr/bin (...or something?)

I'm grasping because I can't reproduce it locally.

References:

GCC's page about dual ABI
Allan McRae's blog post where the above quote was pulled

@krimp
Copy link
Author

krimp commented Nov 16, 2018

No modifications done to the code or mix with clang that I'm aware of . Initially I had Jessie on the RPi3, but was not able to compile gkk with glib 2.19 (make complained about the g_auto()). Seeing that other had succeeded using gkk on Stretch, I upgraded from Jessie to Stretch (and got glib 2.24 iirc ). Could it be that my issues are related to the upgrade from Jessie to Stretch?

@mikaku
Copy link

mikaku commented Nov 16, 2018

JFYI, I compiled the latest version successfully on a Raspberry Pi v3, with CentOS 7 Linux and Bluez 5.50.

The problem with this version is that I get the error ERROR: Unsupported response event type: 0x0011 (Authentication failed event), and then it loses the connection. This happens only with iOS devices, not with Android.

I've not opened an issue because I've already one open and don't want to stress our developer! 😃

So, that's the reason I'm still using the 5.43 which works pretty well, except for the error in #9.

@nettlep
Copy link
Owner

nettlep commented Nov 16, 2018

You might try having it compile with clang instead of gcc. Try:

export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
make distclean
./configure && make

If this works, it's not a solution, but a workaround.

I'm unable to test this, not having access to that development environment any longer (which is why I've been slow/unable to respond to issues, hoping folks will help each other out.)

@krimp
Copy link
Author

krimp commented Nov 16, 2018

Did a recap: Initially I cloned the gkk git when I had Jessie on the RPi. Got some issues with the m4, and "google" adviced me to run autoreconf -f -i. Then I was able to do the make, but stumbled into the g_auto() issue. Then upgraded to Stretch...

Your comment regading the symlink made me think that maybe the autoreconf did something with some files in gobbledegook .

Today I deleted completely the gobbledegook directory and did a fresh clone. Now everything works as it should.

Thank you very much for your help, and for an amacing library package.

@nettlep
Copy link
Owner

nettlep commented Nov 16, 2018

Glad you got it working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants