Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Link failed when using QQuickMaterialStyle in Qt6.4
Forum Updated to NodeBB v4.3 + New Features

Link failed when using QQuickMaterialStyle in Qt6.4

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 155 Views
  • 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.
  • S Offline
    S Offline
    Sauntor
    wrote on last edited by
    #1

    Environment:

    • openSUSE leap 15.5
    • Qt 6.4 from openSUSE's repository

    I add these modules in CMakeLists.txt:

    Qt6::Quick
    Qt6::QuickPrivate
    
    Qt6::QuickControls2
    Qt6::QuickControls2Private
    Qt6::QuickControls2Impl
    Qt6::QuickControls2ImplPrivate
    
    Qt6::QuickTemplates2
    Qt6::QuickTemplates2Private
    

    And with these lines in my sources:

    # In the .h
    #include <QtQuickControls2/private/qquickmaterialstyle_p.h>
    
    # In the .cpp
    QQuickMaterialStyle * underlying = ....;
    underlying->setTheme(QQuickMaterialStyle::System);
    

    Then, compile is ok, but link is failed with the following info:

    x86_64-suse-linux/bin/ld: ../xxx/xxx/libDemo.so: undefined reference to `QQuickMaterialStyle::staticMetaObject'
    

    I also tried adding this to target_link_libraries():
    /usr/lib64/qt6/qml/QtQuick/Controls/Material/libqtquickcontrols2materialstyleplugin.so
    But it's not work.

    If using Qt6.6, the extra CMake modules make it linkable, but no such modules for Qt6.4

    So, how to fix this problem?

    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