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. Qmultimedia cmake trouble
Qt 6.11 is out! See what's new in the release blog

Qmultimedia cmake trouble

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 1.3k Views 1 Watching
  • 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.
  • A Offline
    A Offline
    AliM93
    wrote on last edited by
    #1

    i tried to reproduce a video but i got the error: undefined reference to `QSound::QSound(QString const&, QObject*)'
    i even do not understand why if libraries can be found by qt creator.

    jsulmJ Pl45m4P 2 Replies Last reply
    0
    • A AliM93

      i tried to reproduce a video but i got the error: undefined reference to `QSound::QSound(QString const&, QObject*)'
      i even do not understand why if libraries can be found by qt creator.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @AliM93 Do you have

      QT += multimedia
      

      in your pro file?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A AliM93

        i tried to reproduce a video but i got the error: undefined reference to `QSound::QSound(QString const&, QObject*)'
        i even do not understand why if libraries can be found by qt creator.

        Pl45m4P Offline
        Pl45m4P Offline
        Pl45m4
        wrote on last edited by Pl45m4
        #3

        @AliM93

        multimedia module added? QSound included?


        If debugging is the process of removing software bugs, then programming must be the process of putting them in.

        ~E. W. Dijkstra

        1 Reply Last reply
        0
        • A Offline
          A Offline
          AliM93
          wrote on last edited by
          #4

          i am using cmake file, and i added all the components.
          and yes i include all the things
          thanks

          jsulmJ 1 Reply Last reply
          0
          • A AliM93

            i am using cmake file, and i added all the components.
            and yes i include all the things
            thanks

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @AliM93 So, do you have

            find_package(Qt5 COMPONENTS Multimedia REQUIRED)
            

            in your cmake file?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • A Offline
              A Offline
              AliM93
              wrote on last edited by
              #6

              i think the problem is still in the cmake, probably i have to add somenthing other?
              i post below parts of my cmake

              set(CMAKE_PREFIX_PATH "/opt/5.12.4/gcc_64/lib/cmake/")
              
              find_package(Qt5 COMPONENTS Multimedia REQUIRED)
              
              include_directories(
                  ${Qt5Core_INCLUDE_DIRS}
                  ${Qt5Gui_INCLUDE_DIRS}
                  ${Qt5Widgets_INCLUDE_DIRS}
                  ${Qt5PrintSupport_INCLUDE_DIRS}
                  ${Qt5Sql_INCLUDE_DIRS}
                  ${Qt5Multimedia_INCLUDE_DIRS}
                  ${Qt5MultimediaWidgets_INCLUDE_DIRS}
              
              
              
              
              
                  )
              
              
              

              and it's fine until i didn't code something requiring those libraries. this is way i do not have idea of what i am missing
              maybe something in

              target_link_libraries(agree_gui
              Qt5::Multimedia
              )

              ?

              jsulmJ 1 Reply Last reply
              0
              • A AliM93

                i think the problem is still in the cmake, probably i have to add somenthing other?
                i post below parts of my cmake

                set(CMAKE_PREFIX_PATH "/opt/5.12.4/gcc_64/lib/cmake/")
                
                find_package(Qt5 COMPONENTS Multimedia REQUIRED)
                
                include_directories(
                    ${Qt5Core_INCLUDE_DIRS}
                    ${Qt5Gui_INCLUDE_DIRS}
                    ${Qt5Widgets_INCLUDE_DIRS}
                    ${Qt5PrintSupport_INCLUDE_DIRS}
                    ${Qt5Sql_INCLUDE_DIRS}
                    ${Qt5Multimedia_INCLUDE_DIRS}
                    ${Qt5MultimediaWidgets_INCLUDE_DIRS}
                
                
                
                
                
                    )
                
                
                

                and it's fine until i didn't code something requiring those libraries. this is way i do not have idea of what i am missing
                maybe something in

                target_link_libraries(agree_gui
                Qt5::Multimedia
                )

                ?

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @AliM93 said in Qmultimedia cmake trouble:

                include_directories

                This shouldn't be needed as you're using find_package.

                target_link_libraries(agree_gui
                    Qt5::Multimedia
                )
                

                is needed.

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                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