Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Undefined reference to QtBluetooth class member functions all over Qt project
Forum Updated to NodeBB v4.3 + New Features

Undefined reference to QtBluetooth class member functions all over Qt project

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 2 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    admd91
    wrote on last edited by
    #1

    Hello,

    I configured my Qt Creator to build apps for the i.MX6Q SABRE SD board from Freescale. I followed the guide here: https://community.freescale.com/thread/309578 and my settings are similar to the guide. I have built some apps for my board using these settings and they run fine. I tried building the bluetooth example apps from Qt Connectivity from here:https://qt.gitorious.org/qt/qtconnectivity/source/90448d592bb8b38ac544e868c6e5db9bf37168d8:, but encountered numerous "Undefined reference to .." errors, that point to various members of the QtBluetooth and their functions. Here is a snippet of the compile output:

    @
    chat.o: In function Chat::Chat(QWidget*)': /home/dave/Desktop/OBU/BT/qt-qtconnectivity/examples/build-bluetooth-Yocto_sh-Debug/btchat/../../bluetooth/btchat/chat.cpp:84: undefined reference to QtBluetooth::QBluetoothLocalDevice::QBluetoothLocalDevice(QObject*)'
    /home/dave/Desktop/OBU/BT/qt-qtconnectivity/examples/build-bluetooth-Yocto_sh-Debug/btchat/../../bluetooth/btchat/chat.cpp:84: undefined reference to QtBluetooth::QBluetoothLocalDevice::name() const' /home/dave/Desktop/OBU/BT/qt-qtconnectivity/examples/build-bluetooth-Yocto_sh-Debug/btchat/../../bluetooth/btchat/chat.cpp:84: undefined reference to QtBluetooth::QBluetoothLocalDevice::~QBluetoothLocalDevice()'
    /home/dave/Desktop/OBU/BT/qt-qtconnectivity/examples/build-bluetooth-Yocto_sh-Debug/btchat/../../bluetooth/btchat/chat.cpp:84: undefined reference to QtBluetooth::QBluetoothLocalDevice::~QBluetoothLocalDevice()' chat.o: In function Chat::connectClicked()':
    /home/dave/Desktop/OBU/BT/qt-qtconnectivity/examples/build-bluetooth-Yocto_sh-Debug/btchat/../../bluetooth/btchat/chat.cpp:131: undefined reference to QtBluetooth::QBluetoothUuid::QBluetoothUuid(QString const&)' /home/dave/Desktop/OBU/BT/qt-qtconnectivity/examples/build-bluetooth-Yocto_sh-Debug/btchat/../../bluetooth/btchat/chat.cpp:131: undefined reference to QtBluetooth::QBluetoothUuid::~QBluetoothUuid()'
    chat.o: In function QtBluetooth::QBluetoothServiceInfo::serviceName() const': /home/dave/Desktop/OBU/BT/qt-qtconnectivity/examples/build-bluetooth-Yocto_sh-Debug/btchat/../../../src/bluetooth/qbluetoothserviceinfo.h:185: undefined reference to QtBluetooth::QBluetoothServiceInfo::attribute(unsigned short) const'
    chat.o: In function Chat::connectClicked()': /home/dave/Desktop/OBU/BT/qt-qtconnectivity/examples/build-bluetooth-Yocto_sh-Debug/btchat/../../bluetooth/btchat/chat.cpp:136: undefined reference to QtBluetooth::QBluetoothServiceInfo::device() const'
    /home/dave/Desktop/OBU/BT/qt-qtconnectivity/examples/build-bluetooth-Yocto_sh-Debug/btchat/../../bluetooth/btchat/chat.cpp:136: undefined reference to QtBluetooth::QBluetoothDeviceInfo::name() const' /home/dave/Desktop/OBU/BT/qt-qtconnectivity/examples/build-bluetooth-Yocto_sh-Debug/btchat/../../bluetooth/btchat/chat.cpp:136: undefined reference to QtBluetooth::QBluetoothDeviceInfo::~QBluetoothDeviceInfo()'
    /home/dave/Desktop/OBU/BT/qt-qtconnectivity/examples/build-bluetooth-Yocto_sh-Debug/btchat/../../bluetooth/btchat/chat.cpp:151: undefined reference to QtBluetooth::QBluetoothServiceInfo::~QBluetoothServiceInfo()' /home/dave/Desktop/OBU/BT/qt-qtconnectivity/examples/build-bluetooth-Yocto_sh-Debug/btchat/../../bluetooth/btchat/chat.cpp:151: undefined reference to QtBluetooth::QBluetoothServiceInfo::~QBluetoothServiceInfo()'
    /home/dave/Desktop/OBU/BT/qt-qtconnectivity/examples/build-bluetooth-Yocto_sh-Debug/btchat/../../bluetooth/btchat/chat.cpp:136: undefined reference to QtBluetooth::QBluetoothDeviceInfo::~QBluetoothDeviceInfo()' /home/dave/Desktop/OBU/BT/qt-qtconnectivity/examples/build-bluetooth-Yocto_sh-Debug/btchat/../../bluetooth/btchat/chat.cpp:131: undefined reference to QtBluetooth::QBluetoothUuid::~QBluetoothUuid()'
    chatserver.o: In function ChatServer::ChatServer(QObject*)': /home/dave/Desktop/OBU/BT/qt-qtconnectivity/examples/build-bluetooth-Yocto_sh-Debug/btchat/../../bluetooth/btchat/chatserver.cpp:51: undefined reference to QtBluetooth::QBluetoothServiceInfo::QBluetoothServiceInfo()'
    chatserver.o: In function ChatServer::stopServer()': /home/dave/Desktop/OBU/BT/qt-qtconnectivity/examples/build-bluetooth-Yocto_sh-Debug/btchat/../../bluetooth/btchat/chatserver.cpp:118: undefined reference to QtBluetooth::QBluetoothServiceInfo::unregisterService() const'
    chatserver.o: In function qobject_cast<QtBluetooth::QBluetoothSocket*>': /opt/poky/1.5.3/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi//usr/include/qt4/QtCore/qobject.h:380: undefined reference to QtBluetooth::QBluetoothSocket::staticMetaObject'
    /opt/poky/1.5.3/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi//usr/include/qt4/QtCore/qobject.h:380: undefined reference to QtBluetooth::QBluetoothSocket::staticMetaObject' chatserver.o: In function ChatServer::readSocket()':
    /home/dave/Desktop/OBU/BT/qt-qtconnectivity/examples/build-bluetooth-Yocto_sh-Debug/btchat/../../bluetooth/btchat/chatserver.cpp:179: undefined reference to `QtBluetooth::QBluetoothSocket::peerName() const'
    @

    I was thinking the problem stems from the fact that I am using an older version of Qt (4.8.5), since the target board supports only up to that version I think. Also, at the start of the compile process I get warnings like this:

    @
    Project MESSAGE: Warning: unknown QT: bluetooth
    Project MESSAGE: Warning: unknown QT: quick
    @

    From what I've read so far "quick" is only for Qt5, and "declarative" is its Qt4 counterpart, so I replaced all instances of quick, QQuick and QtQuick with declarative QDeclarative and QtDeclarative. But I still get warnings for unknown QT: bluetooth.

    Anyone can help me with this? Thanks

    1 Reply Last reply
    0
    • tomasz3dkT Offline
      tomasz3dkT Offline
      tomasz3dk
      wrote on last edited by
      #2

      Bluetooth module is in Qt since 5.2 version.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved