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

Qt 5.12.6 cmake static linking qml plugins

    XMLWordPrintable

Details

    • Linux/X11

    Description

      I 'm trying to build a project using a static QT cmake assembly. But when I link libraries, I get a mistake.

       

      //
      cmake_minimum_required(VERSION 3.5)
      project(untitled123131313 LANGUAGES CXX)
      set(CMAKE_INCLUDE_CURRENT_DIR ON)set(CMAKE_AUTOUIC ON)
      set(CMAKE_AUTOMOC ON)
      set(CMAKE_AUTORCC ON)set(CMAKE_CXX_STANDARD 11)
      set(CMAKE_CXX_STANDARD_REQUIRED ON)find_package(Qt5 COMPONENTS Core Quick Qml OpenGL Network Svg QuickControls2 Sql WebSockets REQUIRED)
      if(ANDROID)
          add_library(untitled123131313 SHARED main.cpp qml.qrc)
      else()
          add_executable(untitled123131313 main.cpp qml.qrc)
      endif()
      find_package(Threads REQUIRED)
      find_package(OpenSSL REQUIRED)
      FIND_PACKAGE(PkgConfig)
      PKG_CHECK_MODULES(GLIB glib-2.0)
      find_library(megalib qtpcre2 PATHS ${_qt5_install_prefix}/../../lib)
      find_library(megalib2 qtharfbuzz PATHS ${_qt5_install_prefix}/../../lib)
      find_library(megalib3 qtlibpng PATHS ${_qt5_install_prefix}/../../lib)
      find_library(quicklibs1 qtquick2plugin PATHS ${_qt5_install_prefix}/../../qml/QtQuick.2)
      find_library(quicklibs2 qtquickcontrols2plugin HINTS ${_qt5_install_prefix}/../../qml/QtQuick/Controls.2/)target_compile_definitions(untitled123131313
        PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
      target_link_libraries(untitled123131313
        PRIVATE     Qt5::Core
        Qt5::Gui
        Qt5::Quick
        Qt5::QuickControls2
        Qt5::OpenGL
        Qt5::Qml
        Qt5::Network
        Qt5::Sql
        Qt5::WebSockets
        Qt5::Svg
        Threads::Threads
        OpenSSL::Crypto
        OpenSSL::SSL
        ${megalib}
        ${megalib2}
        ${megalib3}
        ${CMAKE_DL_LIBS}
        ${GLIB_LDFLAGS}
        ${quicklibs1}
        ${quicklibs2})
      

       

       

      /home/gagarin/Qt/5.12.6/gcc_64_static/qml/QtQuick/Controls.2/libqtquickcontrols2plugin.a(qtquickcontrols2plugin.o): In function `QtQuickControls2Plugin::~QtQuickControls2Plugin()':
      qtquickcontrols2plugin.cpp:(.text._ZN22QtQuickControls2PluginD2Ev+0x1e): undefined reference to `QQuickStylePrivate::reset()'
      qtquickcontrols2plugin.cpp:(.text._ZN22QtQuickControls2PluginD2Ev+0x2c): undefined reference to `QQuickStylePlugin::~QQuickStylePlugin()'
      /home/gagarin/Qt/5.12.6/gcc_64_static/qml/QtQuick/Controls.2/libqtquickcontrols2plugin.a(qtquickcontrols2plugin.o): In function `void QQmlPrivate::createInto<QQuickPaddedRectangle>(void*)':
      qtquickcontrols2plugin.cpp:(.text._ZN11QQmlPrivate10createIntoI21QQuickPaddedRectangleEEvPv[_ZN11QQmlPrivate10createIntoI21QQuickPaddedRectangleEEvPv]+0x7): undefined reference to `QQuickPaddedRectangle::QQuickPaddedRectangle(QQuickItem*)'
      /home/gagarin/Qt/5.12.6/gcc_64_static/qml/QtQuick/Controls.2/libqtquickcontrols2plugin.a(qtquickcontrols2plugin.o): In function `void QQmlPrivate::createInto<QQuickTumblerView>(void*)':
      qtquickcontrols2plugin.cpp:(.text._ZN11QQmlPrivate10createIntoI17QQuickTumblerViewEEvPv[_ZN11QQmlPrivate10createIntoI17QQuickTumblerViewEEvPv]+0x7): undefined reference to `QQuickTumblerView::QQuickTumblerView(QQuickItem*)'
      /home/gagarin/Qt/5.12.6/gcc_64_static/qml/QtQuick/Controls.2/libqtquickcontrols2plugin.a(qtquickcontrols2plugin.o): In function `void QQmlPrivate::createInto<QQuickClippedText>(void*)':
      qtquickcontrols2plugin.cpp:(.text._ZN11QQmlPrivate10createIntoI17QQuickClippedTextEEvPv[_ZN11QQmlPrivate10createIntoI17QQuickClippedTextEEvPv]+0x7): undefined reference to `QQuickClippedText::QQuickClippedText(QQuickItem*)'
      /home/gagarin/Qt/5.12.6/gcc_64_static/qml/QtQuick/Controls.2/libqtquickcontrols2plugin.a(qtquickcontrols2plugin.o): In function `void QQmlPrivate::createInto<QQuickItemGroup>(void*)':
      qtquickcontrols2plugin.cpp:(.text._ZN11QQmlPrivate10createIntoI15QQuickItemGroupEEvPv[_ZN11QQmlPrivate10createIntoI15QQuickItemGroupEEvPv]+0x7): undefined reference to `QQuickItemGroup::QQuickItemGroup(QQuickItem*)'
      /home/gagarin/Qt/5.12.6/gcc_64_static/qml/QtQuick/Controls.2/libqtquickcontrols2plugin.a(qtquickcontrols2plugin.o): In function `QQmlPrivate::QQmlElement<QQuickItemGroup>::~QQmlElement()':
      qtquickcontrols2plugin.cpp:(.text._ZN11QQmlPrivate11QQmlElementI15QQuickItemGroupED2Ev[_ZN11QQmlPrivate11QQmlElementI15QQuickItemGroupED5Ev]+0x2a): undefined reference to `QQuickItemGroup::~QQuickItemGroup()'
      /home/gagarin/Qt/5.12.6/gcc_64_static/qml/QtQuick/Controls.2/libqtquickcontrols2plugin.a(qtquickcontrols2plugin.o): In function `void QQmlPrivate::createInto<QQuickPlaceholderText>(void*)':
      qtquickcontrols2plugin.cpp:(.text._ZN11QQmlPrivate10createIntoI21QQuickPlaceholderTextEEvPv[_ZN11QQmlPrivate10createIntoI21QQuickPlaceholderTextEEvPv]+0x7): undefined reference to `QQuickPlaceholderText::QQuickPlaceholderText(QQuickItem*)'
      /home/gagarin/Qt/5.12.6/gcc_64_static/qml/QtQuick/Controls.2/libqtquickcontrols2plugin.a(qtquickcontrols2plugin.o): In function `void QQmlPrivate::createInto<QQuickColorImage>(void*)':
      qtquickcontrols2plugin.cpp:(.text._ZN11QQmlPrivate10createIntoI16QQuickColorImageEEvPv[_ZN11QQmlPrivate10createIntoI16QQuickColorImageEEvPv]+0x7): undefined reference to `QQuickColorImage::QQuickColorImage(QQuickItem*)'
      /home/gagarin/Qt/5.12.6/gcc_64_static/qml/QtQuick/Controls.2/libqtquickcontrols2plugin.a(qtquickcontrols2plugin.o): In function `void QQmlPrivate::createInto<QQuickIconImage>(void*)':
      qtquickcontrols2plugin.cpp:(.text._ZN11QQmlPrivate10createIntoI15QQuickIconImageEEvPv[_ZN11QQmlPrivate10createIntoI15QQuickIconImageEEvPv]+0x7): undefined reference to `QQuickIconImage::QQuickIconImage(QQuickItem*)'
      /home/gagarin/Qt/5.12.6/gcc_64_static/qml/QtQuick/Controls.2/libqtquickcontrols2plugin.a(qtquickcontrols2plugin.o): In function `void QQmlPrivate::createInto<QQuickIconLabel>(void*)':
      qtquickcontrols2plugin.cpp:(.text._ZN11QQmlPrivate10createIntoI15QQuickIconLabelEEvPv[_ZN11QQmlPrivate10createIntoI15QQuickIconLabelEEvPv]+0x7): undefined reference to `QQuickIconLabel::QQuickIconLabel(QQuickItem*)'

       

      In main file:

      Q_IMPORT_PLUGIN(QtQuick2Plugin)
      Q_IMPORT_PLUGIN(QtQuickControls2Plugin)

       

      Attachments

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

        Activity

          People

            alexandru.croitor Alexandru Croitor
            man_k28 Stanislav Prokofev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes