Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-54030

Adding "QT += bluetooth" to qmake does not automatically link QtNetwork

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.6.1
    • None

    Description

      I have this pro file:

      QT += bluetooth
      CONFIG += c++11
      QMAKE_CXXFLAGS += -fkeep-inline-functions
      TARGET = QtBluetooth-inlines
      TEMPLATE = lib
      SOURCES += QtBluetooth-inlines.cpp
      

      with this cpp:

      #include <QtBluetooth>
      

      The compilation fails with:

      debug/QtBluetooth-inlines.o: In function `ZN15QAbstractSocket2trEPKcS1_i':
      C:/Qt/Qt5.6.1/5.6/mingw49_32/include/QtNetwork/qabstractsocket.h:55: undefined reference to `_imp___ZN15QAbstractSocket16staticMetaObjectE'
      debug/QtBluetooth-inlines.o: In function `ZN15QAbstractSocket6trUtf8EPKcS1_i':
      C:/Qt/Qt5.6.1/5.6/mingw49_32/include/QtNetwork/qabstractsocket.h:55: undefined reference to `_imp___ZN15QAbstractSocket16staticMetaObjectE'
      debug/QtBluetooth-inlines.o: In function `Z20qt_getEnumMetaObjectN15QAbstractSocket10SocketTypeE':
      C:/Qt/Qt5.6.1/5.6/mingw49_32/include/QtNetwork/qabstractsocket.h:62: undefined reference to `_imp___ZN15QAbstractSocket16staticMetaObjectE'
      debug/QtBluetooth-inlines.o: In function `Z20qt_getEnumMetaObjectN15QAbstractSocket20NetworkLayerProtocolE':
      C:/Qt/Qt5.6.1/5.6/mingw49_32/include/QtNetwork/qabstractsocket.h:69: undefined reference to `_imp___ZN15QAbstractSocket16staticMetaObjectE'
      debug/QtBluetooth-inlines.o: In function `Z20qt_getEnumMetaObjectN15QAbstractSocket11SocketErrorE':
      C:/Qt/Qt5.6.1/5.6/mingw49_32/include/QtNetwork/qabstractsocket.h:97: undefined reference to `_imp___ZN15QAbstractSocket16staticMetaObjectE'
      debug/QtBluetooth-inlines.o:C:/Qt/Qt5.6.1/5.6/mingw49_32/include/QtNetwork/qabstractsocket.h:107: more undefined references to `_imp___ZN15QAbstractSocket16staticMetaObjectE' follow
      collect2.exe: error: ld returned 1 exit status
      

      If any parts of QtBluetooth depend on QtNetwork, the latter module should be automatically linked when QtBluetooth is included as a module ("QT += bluetooth").

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ablasche Alex Blasche
            ddobrev Dimitar Dobrev
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes