Promoted Widget 'header not found' on compile
-
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 -
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.txtif you are using cmake?@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 -
@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@ThePreviousOne
And doesorderstable.hfile exist in the same directory as all the other files?
And what line in what file causes the 'No such file or directory'? -
This post is deleted!
-
@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

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 -
@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

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@ThePreviousOne
I have not done it, but isn't the requirement for cmake spelt out at https://stackoverflow.com/a/75609319/489865For 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?
-
@ThePreviousOne
I have not done it, but isn't the requirement for cmake spelt out at https://stackoverflow.com/a/75609319/489865For 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?
@JonB Thanks
include_directories(<include directory>)worked.