Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Cmake is not linking
Forum Updated to NodeBB v4.3 + New Features

Cmake is not linking

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 1.3k 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
    Stoepsler
    wrote on last edited by
    #1

    Hi there,

    I have a problem regarding QT and cmake:

    In my application I'm using QML to program the view and in there I'm using .svg files as images and also import Multimedia 5.0 to play sounds.

    Therefore I've added following lines to my CmakeList.txt:
    FIND_PACKAGE(Qt5 REQUIRED COMPONENTS Multimedia Svg)
    TARGET_LINK_LIBRARIES(target Qt5::Multimedia Qt5::Svg)
    together with Qt5 Core, Gui, Qml and so on.

    Unfortunately the multimedia and SVG packages are not linked as dependencies of the executable, as these aren't needed from the c++ backend.

    When trying to deploy the application under windows 7 with windeployqt.exe from the QT-binary path, the dependencies to these to packages are not recognized as these aren't in the application ...
    Somehow there is a crude dependency to SVG, so it is added by the tool but is not shown as a direct dependency of my file.

    When executing my application the qml component using the multimedia package is blaming about the missing library.

    Anybody any suggestions on how to force the linking of the packages ?

    The application is develeoped in and deployed to windows 7.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      th.thielemann
      wrote on last edited by
      #2

      It should not be necessary to prepend with "Qt5::"
      Just use:

      find_package(Qt5Svg REQUIRED)
      find_package(Qt5Multimedia REQUIRED)
      
      ...
      qt5_use_modules(target Multimedia Svg)
      target_link_libraries(target MyOtherLibs)
      
      1 Reply Last reply
      0
      • S Offline
        S Offline
        Stoepsler
        wrote on last edited by Stoepsler
        #3

        Sry, but your approach isn't working also. The mulitmedia and svg packages are still not linked as dependencies into the executable.

        Other packages as core and network are linked though, but those were also already linked before ...

        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