Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. Failed to find required Qt component "WebEngineWidgets". Expected Config file at "D:/QT/6.6.0/mingw_64/lib/cmake/Qt6WebEngineWidgets/Qt6WebEngineWidgetsConfig.cmake" does NOT exist

Failed to find required Qt component "WebEngineWidgets". Expected Config file at "D:/QT/6.6.0/mingw_64/lib/cmake/Qt6WebEngineWidgets/Qt6WebEngineWidgetsConfig.cmake" does NOT exist

Scheduled Pinned Locked Moved Unsolved QtWebEngine
qtwebeginecmakeconfignot founderror
4 Posts 2 Posters 1.1k 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.
  • F Offline
    F Offline
    Futuray Programming
    wrote on 22 Feb 2024, 10:16 last edited by
    #1

    Hello !
    I'm trying to create a basic QtWebEngine app. But my CMake doesn't work.
    Here is the CMake:

    cmake_minimum_required(VERSION 3.5)
    
    project(webengine VERSION 0.1 LANGUAGES CXX)
    
    set(CMAKE_INCLUDE_CURRENT_DIR ON)
    
    set(CMAKE_AUTOUIC ON)
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_AUTORCC ON)
    
    set(CMAKE_CXX_STANDARD 20)
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
    
    find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
    find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)
    find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Network)
    find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS WebEngineWidgets)
    
    set(PROJECT_SOURCES
        main.cpp
        mainwindow.cpp
        mainwindow.h
    )
    
    if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
        qt_add_executable(webengine
            MANUAL_FINALIZATION
            ${PROJECT_SOURCES}
        )
    # Define target properties for Android with Qt 6 as:
    #    set_property(TARGET main APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
    #                 ${CMAKE_CURRENT_SOURCE_DIR}/android)
    # For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation
    else()
        if(ANDROID)
            add_library(webengine SHARED
                ${PROJECT_SOURCES}
            )
    # Define properties for Android with Qt 5 after find_package() calls as:
    #    set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
        else()
            add_executable(webengine
                ${PROJECT_SOURCES}
            )
        endif()
    endif()
    
    target_link_libraries(webengine PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
    target_link_libraries(webengine PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::WebEngineWidgets)
    target_link_libraries(webengine PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network)
    
    set_target_properties(webengine PROPERTIES
        MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
        MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
        MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
        MACOSX_BUNDLE TRUE
        WIN32_EXECUTABLE TRUE
    )
    
    install(TARGETS webengine
        BUNDLE DESTINATION .
        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
    
    if(QT_VERSION_MAJOR EQUAL 6)
        qt_finalize_executable(webengine)
    endif()
    

    And here is the complete error:

    -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) 
    -- Could NOT find Qt6WebEngineWidgets (missing: Qt6WebEngineWidgets_DIR)
    CMake Error at CMakeLists.txt:17 (find_package):
      Found package configuration file:
    
        D:/QT/6.6.0/mingw_64/lib/cmake/Qt6/Qt6Config.cmake
    
      but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
      FOUND.  Reason given by package:
    
      Failed to find required Qt component "WebEngineWidgets".
    
      Expected Config file at
      "D:/QT/6.6.0/mingw_64/lib/cmake/Qt6WebEngineWidgets/Qt6WebEngineWidgetsConfig.cmake"
      does NOT exist
    

    I already search on other topics, but I didn't find anything to fix my error.

    Thank you in advance,
    Futuray

    C 1 Reply Last reply 22 Feb 2024, 10:18
    0
    • F Futuray Programming
      22 Feb 2024, 10:16

      Hello !
      I'm trying to create a basic QtWebEngine app. But my CMake doesn't work.
      Here is the CMake:

      cmake_minimum_required(VERSION 3.5)
      
      project(webengine VERSION 0.1 LANGUAGES CXX)
      
      set(CMAKE_INCLUDE_CURRENT_DIR ON)
      
      set(CMAKE_AUTOUIC ON)
      set(CMAKE_AUTOMOC ON)
      set(CMAKE_AUTORCC ON)
      
      set(CMAKE_CXX_STANDARD 20)
      set(CMAKE_CXX_STANDARD_REQUIRED ON)
      
      find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
      find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)
      find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Network)
      find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS WebEngineWidgets)
      
      set(PROJECT_SOURCES
          main.cpp
          mainwindow.cpp
          mainwindow.h
      )
      
      if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
          qt_add_executable(webengine
              MANUAL_FINALIZATION
              ${PROJECT_SOURCES}
          )
      # Define target properties for Android with Qt 6 as:
      #    set_property(TARGET main APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
      #                 ${CMAKE_CURRENT_SOURCE_DIR}/android)
      # For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation
      else()
          if(ANDROID)
              add_library(webengine SHARED
                  ${PROJECT_SOURCES}
              )
      # Define properties for Android with Qt 5 after find_package() calls as:
      #    set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
          else()
              add_executable(webengine
                  ${PROJECT_SOURCES}
              )
          endif()
      endif()
      
      target_link_libraries(webengine PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
      target_link_libraries(webengine PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::WebEngineWidgets)
      target_link_libraries(webengine PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network)
      
      set_target_properties(webengine PROPERTIES
          MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
          MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
          MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
          MACOSX_BUNDLE TRUE
          WIN32_EXECUTABLE TRUE
      )
      
      install(TARGETS webengine
          BUNDLE DESTINATION .
          LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
      
      if(QT_VERSION_MAJOR EQUAL 6)
          qt_finalize_executable(webengine)
      endif()
      

      And here is the complete error:

      -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) 
      -- Could NOT find Qt6WebEngineWidgets (missing: Qt6WebEngineWidgets_DIR)
      CMake Error at CMakeLists.txt:17 (find_package):
        Found package configuration file:
      
          D:/QT/6.6.0/mingw_64/lib/cmake/Qt6/Qt6Config.cmake
      
        but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
        FOUND.  Reason given by package:
      
        Failed to find required Qt component "WebEngineWidgets".
      
        Expected Config file at
        "D:/QT/6.6.0/mingw_64/lib/cmake/Qt6WebEngineWidgets/Qt6WebEngineWidgetsConfig.cmake"
        does NOT exist
      

      I already search on other topics, but I didn't find anything to fix my error.

      Thank you in advance,
      Futuray

      C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 22 Feb 2024, 10:18 last edited by
      #2

      WebEngine does not support MinGW. So either switch to MSVC or don't use it.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1
      • F Offline
        F Offline
        Futuray Programming
        wrote on 22 Feb 2024, 10:24 last edited by
        #3

        Ok, thank !
        But, does it exit an other way to run a HTML/js code using Qt ?

        C 1 Reply Last reply 22 Feb 2024, 12:07
        0
        • F Futuray Programming
          22 Feb 2024, 10:24

          Ok, thank !
          But, does it exit an other way to run a HTML/js code using Qt ?

          C Offline
          C Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 22 Feb 2024, 12:07 last edited by
          #4

          @Futuray-Programming That's what WebEngine is made for.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          1

          4/4

          22 Feb 2024, 12:07

          • Login

          • Login or register to search.
          4 out of 4
          • First post
            4/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved