Undefined reference to QtBluetooth class member functions all over Qt project
-
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 functionChat::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 toQtBluetooth::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 toQtBluetooth::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 toQtBluetooth::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 functionQtBluetooth::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 functionChat::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 toQtBluetooth::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 toQtBluetooth::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 toQtBluetooth::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 functionChatServer::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 functionChatServer::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 functionqobject_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 toQtBluetooth::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