Skip to content

Linker error on Linux64 #2

@lnxdxC

Description

@lnxdxC

Hi all,
thank you for providing the cpp-samples.

I am about to bring this onto an Linux64 architecture. Therefore, I cloned your repo and downloaded the linker files as mentioned in your readme.

I adapted the simpleApp.cpp to be used with bluetooth. Therefore, I changed in #16:
const std::string MAC_Addres = "BTH00:07:80:XX:XX:XX"; // the MAC were tested successfully with the python example

If I try to compile the file simpleApp.cpp by using the following setting:

g++ -o main simpleApp.cpp -L:Linux64 libplux.a -std=c++11

I receive the following error:

/usr/bin/ld: /tmp/ccl8F7kH.o: in function main':
simpleApp.cpp:(.text+0x140): undefined reference to SimpleDev::version[abi:cxx11]()' /usr/bin/ld: simpleApp.cpp:(.text+0x205): undefined reference to SimpleDev::start(float, std::vector<int, std::allocator > const&, int)'
/usr/bin/ld: simpleApp.cpp:(.text+0x29d): undefined reference to SimpleDev::read(std::vector<SimpleDev::Frame, std::allocator<SimpleDev::Frame> >&)' /usr/bin/ld: simpleApp.cpp:(.text+0x375): undefined reference to SimpleDev::stop()'
/usr/bin/ld: /tmp/ccl8F7kH.o: in function SimpleDev::SignalsDevX::SignalsDevX(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': simpleApp.cpp:(.text._ZN9SimpleDev11SignalsDevXC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN9SimpleDev11SignalsDevXC5ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x2a): undefined reference to vtable for SimpleDev::SignalsDevX'
/usr/bin/ld: /tmp/ccl8F7kH.o: in function SimpleDev::SignalsDevX::~SignalsDevX()': simpleApp.cpp:(.text._ZN9SimpleDev11SignalsDevXD2Ev[_ZN9SimpleDev11SignalsDevXD5Ev]+0x13): undefined reference to vtable for SimpleDev::SignalsDevX'
/usr/bin/ld: libplux.a(bth_linux.o): in function BTH::BTH(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': bth_linux.cpp:(.text+0x5c9): undefined reference to str2ba'
/usr/bin/ld: libplux.a(bth_linux.o): in function BTH::findDevices()': bth_linux.cpp:(.text+0x897): undefined reference to hci_get_route'
/usr/bin/ld: bth_linux.cpp:(.text+0x8a8): undefined reference to hci_open_dev' /usr/bin/ld: bth_linux.cpp:(.text+0x8e4): undefined reference to hci_inquiry'
/usr/bin/ld: bth_linux.cpp:(.text+0xa6d): undefined reference to ba2str' /usr/bin/ld: bth_linux.cpp:(.text+0xa84): undefined reference to hci_read_remote_name'`

Additionally, I had to include the following lib in simpleDev.h to use sprintf in #37 in simpleDev.cpp in Linux:

  • #include <stdio.h>

Do you provide a more open lib to debug the issue as well?

Best
Daniel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions