Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Promoted Widget 'header not found' on compile
Forum Updated to NodeBB v4.3 + New Features

Promoted Widget 'header not found' on compile

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
8 Posts 2 Posters 104 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.
  • T Offline
    T Offline
    ThePreviousOne
    wrote last edited by aha_1980
    #1

    After Compiling with a promoted widget I get a 'No such file or directory' error for the header of the new widget.
    I'm trying to point it at an existing header file, for a widget I was previously adding and initializing manually.
    Looking online, the only answers I could find were 5~10 years old and were for qmake

    1 Reply Last reply
    0
    • JonBJ Offline
      JonBJ Offline
      JonB
      wrote last edited by
      #2

      Well, where is the header file relative to the rest of your sources, how do you include it and what is your include path? And maybe the relevant parts of your CMakeLists.txt if you are using cmake?

      T 1 Reply Last reply
      0
      • JonBJ JonB

        Well, where is the header file relative to the rest of your sources, how do you include it and what is your include path? And maybe the relevant parts of your CMakeLists.txt if you are using cmake?

        T Offline
        T Offline
        ThePreviousOne
        wrote last edited by ThePreviousOne
        #3

        @JonB my include path is just the project root (I'll organize everything when the program is finished)

        qt_add_executable(app
            MANUAL_FINALIZATION
            ${PROJECT_SOURCES}
            combosdialog.h combosdialog.cpp combosdialog.ui
            menuitemsdialog.h menuitemsdialog.cpp menuitemsdialog.ui
            qvaluebutton.h qvaluebutton.cpp
        
            categoryframe.h categoryframe.cpp categoryframe.ui
            utils.h utils.cpp
            customerframe.h customerframe.cpp customerframe.ui
            orderstable.h orderstable.cpp  //<-- this one
        
        JonBJ 1 Reply Last reply
        0
        • T ThePreviousOne

          @JonB my include path is just the project root (I'll organize everything when the program is finished)

          qt_add_executable(app
              MANUAL_FINALIZATION
              ${PROJECT_SOURCES}
              combosdialog.h combosdialog.cpp combosdialog.ui
              menuitemsdialog.h menuitemsdialog.cpp menuitemsdialog.ui
              qvaluebutton.h qvaluebutton.cpp
          
              categoryframe.h categoryframe.cpp categoryframe.ui
              utils.h utils.cpp
              customerframe.h customerframe.cpp customerframe.ui
              orderstable.h orderstable.cpp  //<-- this one
          
          JonBJ Offline
          JonBJ Offline
          JonB
          wrote last edited by
          #4

          @ThePreviousOne
          And does orderstable.h file exist in the same directory as all the other files?
          And what line in what file causes the 'No such file or directory'?

          1 Reply Last reply
          0
          • T Offline
            T Offline
            ThePreviousOne
            wrote last edited by ThePreviousOne
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • T Offline
              T Offline
              ThePreviousOne
              wrote last edited by
              #6

              @JonB yes it does
              sorry I couldn't copy paste the error, anyway the problem is that the error shows up in the generated file
              Screenshot_20251201_151145.png

              Am I really expected to paste the file into my build directory every time? That seems dumb if so
              Edit: just tried and got 'Too many levels of a symbolic link' so I guess even that hack is Out as an option

              JonBJ 1 Reply Last reply
              0
              • T ThePreviousOne

                @JonB yes it does
                sorry I couldn't copy paste the error, anyway the problem is that the error shows up in the generated file
                Screenshot_20251201_151145.png

                Am I really expected to paste the file into my build directory every time? That seems dumb if so
                Edit: just tried and got 'Too many levels of a symbolic link' so I guess even that hack is Out as an option

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote last edited by JonB
                #7

                @ThePreviousOne
                I have not done it, but isn't the requirement for cmake spelt out at https://stackoverflow.com/a/75609319/489865

                For CMake, it needs to have include directory paths to work with. In CMakeLists this can be done by include directory directives. For Example:

                include_directories(${CMAKE_CURRENT_SOURCE_DIR})

                If the header files are in separate include folder then this should be written in CMakeLists:

                include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)

                (Or maybe target_include_directories(<YOUR PROJECT NAME> PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})?)

                Do you have the first of the above in your CMakeLists.txt?

                T 1 Reply Last reply
                1
                • JonBJ JonB

                  @ThePreviousOne
                  I have not done it, but isn't the requirement for cmake spelt out at https://stackoverflow.com/a/75609319/489865

                  For CMake, it needs to have include directory paths to work with. In CMakeLists this can be done by include directory directives. For Example:

                  include_directories(${CMAKE_CURRENT_SOURCE_DIR})

                  If the header files are in separate include folder then this should be written in CMakeLists:

                  include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)

                  (Or maybe target_include_directories(<YOUR PROJECT NAME> PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})?)

                  Do you have the first of the above in your CMakeLists.txt?

                  T Offline
                  T Offline
                  ThePreviousOne
                  wrote last edited by ThePreviousOne
                  #8

                  @JonB Thanks include_directories(<include directory>) worked.

                  1 Reply Last reply
                  1

                  • Login

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