Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. header file not found
QtWS25 Last Chance

header file not found

Scheduled Pinned Locked Moved Solved C++ Gurus
8 Posts 3 Posters 866 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.
  • slackujS Offline
    slackujS Offline
    slackuj
    wrote on last edited by
    #1

    Hello,
    I was trying to compile the"" https://github.com/KDABLabs/kdabtv/tree/master/Qt-Widgets-and-more/WidgetPromotion "" using Cmake but i am getting following error:

    Debug/qtDesignerPlugins_autogen/include/ui_ImageViewer.h</a>:16:10: fatal error: FileSelector.h: No such file or directory
    16 | #include "FileSelector.h"
    | ^~~~~~~~~~~~~~~~

    can anyone please tell me what could have gone wrong?

    Thanks

    JonBJ Christian EhrlicherC 2 Replies Last reply
    0
    • slackujS slackuj

      Hello,
      I was trying to compile the"" https://github.com/KDABLabs/kdabtv/tree/master/Qt-Widgets-and-more/WidgetPromotion "" using Cmake but i am getting following error:

      Debug/qtDesignerPlugins_autogen/include/ui_ImageViewer.h</a>:16:10: fatal error: FileSelector.h: No such file or directory
      16 | #include "FileSelector.h"
      | ^~~~~~~~~~~~~~~~

      can anyone please tell me what could have gone wrong?

      Thanks

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @slackuj
      I am not an expert (and never used cmake). FileSelector.h should be in your original sources directory (it is there, isn't it? And if you are under Linux then it must have those capital letters), the ui_...h is in some autogen area. Is that supposed to be the case? Do you need to add your source directory to the "include directories" of cmake, so that it passes -I... for that to the compiler invocation?

      1 Reply Last reply
      0
      • slackujS slackuj

        Hello,
        I was trying to compile the"" https://github.com/KDABLabs/kdabtv/tree/master/Qt-Widgets-and-more/WidgetPromotion "" using Cmake but i am getting following error:

        Debug/qtDesignerPlugins_autogen/include/ui_ImageViewer.h</a>:16:10: fatal error: FileSelector.h: No such file or directory
        16 | #include "FileSelector.h"
        | ^~~~~~~~~~~~~~~~

        can anyone please tell me what could have gone wrong?

        Thanks

        Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @slackuj said in header file not found:

        can anyone please tell me what could have gone wrong?

        Since you did not post your CMakeLists.txt I would guess you forgot to add the current source directory to the include directories.

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

        slackujS 1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          @slackuj said in header file not found:

          can anyone please tell me what could have gone wrong?

          Since you did not post your CMakeLists.txt I would guess you forgot to add the current source directory to the include directories.

          slackujS Offline
          slackujS Offline
          slackuj
          wrote on last edited by
          #4

          @Christian-Ehrlicher should i call --- target_include_directories(businesslogic INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) ?

          How should i call it?

          my CmakeLists.txt file is:

          cmake_minimum_required(VERSION 3.5)

          project(qtDesignerPlugins VERSION 0.1 LANGUAGES CXX)

          set(CMAKE_AUTOUIC ON)
          set(CMAKE_AUTOMOC ON)
          set(CMAKE_AUTORCC ON)

          set(CMAKE_CXX_STANDARD 17)
          set(CMAKE_CXX_STANDARD_REQUIRED ON)

          find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
          find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)

          set(PROJECT_SOURCES
          main.cpp
          ImageViewer.cpp
          FileSelector.cpp
          FileSelector.h
          ImageViewer.h
          ImageViewer.ui

          )

          if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
          qt_add_executable(qtDesignerPlugins
          MANUAL_FINALIZATION
          ${PROJECT_SOURCES}
          )

          Define target properties for Android with Qt 6 as:

          set_property(TARGET qtDesignerPlugins 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(qtDesignerPlugins 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(qtDesignerPlugins
                  ${PROJECT_SOURCES}
                  FileSelector.h FileSelector.cpp
                  ImageViewer.h ImageViewer.cpp ImageViewer.ui
              )
          endif()
          

          endif()

          target_link_libraries(qtDesignerPlugins PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)

          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.

          if(${QT_VERSION} VERSION_LESS 6.1.0)
          set(BUNDLE_ID_OPTION MACOSX_BUNDLE_GUI_IDENTIFIER com.example.qtDesignerPlugins)
          endif()
          set_target_properties(qtDesignerPlugins PROPERTIES
          ${BUNDLE_ID_OPTION}
          MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
          MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
          MACOSX_BUNDLE TRUE
          WIN32_EXECUTABLE TRUE
          )

          include(GNUInstallDirs)
          install(TARGETS qtDesignerPlugins
          BUNDLE DESTINATION .
          LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
          RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
          )

          if(QT_VERSION_MAJOR EQUAL 6)
          qt_finalize_executable(qtDesignerPlugins)
          endif()

          1 Reply Last reply
          0
          • slackujS Offline
            slackujS Offline
            slackuj
            wrote on last edited by
            #5

            Screenshot_20240413_095041.png

            Screenshot_20240413_095055.png

            Christian EhrlicherC 1 Reply Last reply
            0
            • slackujS slackuj

              Screenshot_20240413_095041.png

              Screenshot_20240413_095055.png

              Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @slackuj please use code tags to format your file. I can not read anything and already told you what is missing.

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

              slackujS 1 Reply Last reply
              0
              • Christian EhrlicherC Christian Ehrlicher

                @slackuj please use code tags to format your file. I can not read anything and already told you what is missing.

                slackujS Offline
                slackujS Offline
                slackuj
                wrote on last edited by
                #7

                @Christian-Ehrlicher
                I am sorry, but could you please tell me how to use the code tag?

                I am sorry again, I am just a newbie.

                1 Reply Last reply
                0
                • slackujS Offline
                  slackujS Offline
                  slackuj
                  wrote on last edited by
                  #8

                  i compiled it successfully using qmake.

                  1 Reply Last reply
                  0
                  • slackujS slackuj has marked this topic as solved on

                  • Login

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