Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Xcode fails builds after adding multimedia in CMakeLists.txt

Xcode fails builds after adding multimedia in CMakeLists.txt

Scheduled Pinned Locked Moved Solved Mobile and Embedded
4 Posts 2 Posters 264 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.
  • K Offline
    K Offline
    Kiovtorov
    wrote on last edited by Kiovtorov
    #1

    Hi, I am new to building and deploying a qt app to iOS Simulator and I get a build error when I try to add multimedia in the CMakeLists.txt. I guess it would be the same for networkauth. I will attach an image of the build errors in Xcode but they are just linking errors
    Screenshot 2024-11-23 at 20.09.50.png Screenshot 2024-11-23 at 20.09.00.png

    Here is my CMakeLists.txt

    cmake_minimum_required(VERSION 3.16)
    
    project(ios2 VERSION 0.1 LANGUAGES CXX)
    
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
    set(CMAKE_OSX_DEPLOYMENT_TARGET "13.0")
    find_package(Qt6 6.5 REQUIRED COMPONENTS Quick Multimedia)
    
    qt_standard_project_setup(REQUIRES 6.5)
    
    qt_add_executable(appios2
        main.cpp
    )
    
    qt_add_qml_module(appios2
        URI ios2
        VERSION 1.0
        QML_FILES
            Main.qml
    )
    
    # Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
    # If you are developing for iOS or macOS you should consider setting an
    # explicit, fixed bundle identifier manually though.
    set_target_properties(appios2 PROPERTIES
    #    MACOSX_BUNDLE_GUI_IDENTIFIER com.example.appios2
        MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
        MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
        MACOSX_BUNDLE TRUE
        WIN32_EXECUTABLE TRUE
    )
    
    target_link_libraries(appios2
        PRIVATE Qt6::Quick
        PRIVATE Qt6::Multimedia
    )
    
    include(GNUInstallDirs)
    install(TARGETS appios2
        BUNDLE DESTINATION .
        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
    )
    
    

    It built and deployed when Multimedia is not added as a library

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      You are likely missing some dependencies. See: https://doc.qt.io/qt-6/qtmultimedia-apple.html

      (Z(:^

      K 1 Reply Last reply
      0
      • sierdzioS sierdzio

        You are likely missing some dependencies. See: https://doc.qt.io/qt-6/qtmultimedia-apple.html

        K Offline
        K Offline
        Kiovtorov
        wrote on last edited by
        #3

        @sierdzio
        You were correct. Thanks for the answer.

        1 Reply Last reply
        0
        • K Kiovtorov has marked this topic as solved on
        • K Offline
          K Offline
          Kiovtorov
          wrote on last edited by
          #4

          I am now facing a problem with NetworkAuth and WebAssembly. I opened another request but got left behind
          https://forum.qt.io/topic/159704/how-to-install-qtnetworkauth-for-webassemby/8?_=1732390034893

          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