Headers not found
-
Hi all,
Still trying to port from Qt4 to Qt6.
From the advice of this post https://forum.qt.io/post/832681, I have rewritten the CMakelist.text# --- Sous-projet src --- cmake_minimum_required(VERSION 3.16) # Trouver Qt6 et ses modules nécessaires find_package(Qt6 REQUIRED COMPONENTS Widgets Sql Xml PrintSupport LinguistTools) qt_standard_project_setup() # --- Fichiers sources et ressources --- qt_add_executable(OT2 otmainwindow.cpp otutils.cpp otdbprefpane.cpp otapplication.cpp otprefwizard.cpp otpathprefpane.cpp otnavwidget.cpp otlistview.cpp otprefdlg.cpp otlistviewitem.cpp ottreesummary.cpp ottreeview.cpp otnewtreedlg.cpp otnewpicdlg.cpp otneweventdlg.cpp otindexedlistitem.cpp oteventsummary.cpp otpixlabelnodistort.cpp otpicsummary.cpp otpicview.cpp otpotsummary.cpp oteventview.cpp otpotview.cpp otnewpotdlg.cpp ot2.cpp ottreehistorytopwidget.cpp ottreehistoryview.cpp otabstractnavwidget.cpp otlinenavwidget.cpp otpicdisplay.cpp oteventdisplay.cpp otpothistoryview.cpp otpotevent.cpp otpothistorytopwidget.cpp otfullsizepicview.cpp otscalepicwidget.cpp otnewspeciesdlg.cpp otsetupwidget.cpp othomewidget.cpp otmanual.cpp otabout.cpp ottreehistorybotttomwidget.cpp ottableview.cpp otchoosedefaultpic.cpp othtmlexportdlg.cpp otmiscprefpane.cpp otabstracttableview.cpp otcheckbox.cpp oteventtable.cpp ottreetable.cpp otpicturetable.cpp otnewpicbox.cpp otpicturelistwidget.cpp oteditpicdlg.cpp otpottable.cpp otstyletable.cpp otsheetwidget.cpp otsheetlist.cpp otindexedaction.cpp otresizerobject.cpp otresizingthread.cpp otloadimagethread.cpp otpicupdateevent.cpp otupdatepothistoryevent.cpp otupdatetreehistoryevent.cpp oteventnavwidget.cpp ottreeevent.cpp otpothevent.cpp oteventdisplayview.cpp otexportcollectionwizard.cpp otecwizardpage1.cpp otecwizardpage2.cpp otimportcollectionwizard.cpp oticwizardpage1.cpp oticwizardpage2.cpp otresizingwizard.cpp otresizingpref.cpp dbprefpane.ui prefwizard.ui navwidget.ui mainwindow.ui newtreedlg.ui newpicdlgtemp.ui neweventdlg.ui newpotdlg.ui linenavwidget.ui editpicdlgtemp.ui eventnavwidget.ui ) set(RESOURCES ot2.qrc) # --- Gestion des traductions --- set(TRANSLATIONS ot2.french.ts ot2.german.ts ot2.dutch.ts ot2.spanish.ts ot2.japanese.ts ) qt_add_translation(QM_FILES ${TRANSLATIONS}) qt_add_resources(ot2.qrc) # --- Lien avec Qt --- target_link_libraries(OT2 PRIVATE Qt6::Widgets Qt6::Sql Qt6::Xml Qt6::PrintSupport )First problem :
/home/alain/devel/ot2-src-1.1/src/otpicview.h:23: erreur : otlistview.h: No such file or directory In file included from /home/alain/devel/ot2-src-1.1/src/otmainwindow.cpp:56: /home/alain/devel/ot2-src-1.1/src/otpicview.h:23:10: fatal error: otlistview.h: No such file or directory 23 | #include <otlistview.h> | ^~~~~~~~~~~~~~though :
ls otlistview* otlistview.cpp otlistview.h otlistviewitem.cpp otlistviewitem.hIn another place, I useI an ui file that uses a promoted Widget.
This widget and its header is confirgured in qtcreator (see pic)

but still, at compile time I get :/home/alain/devel/ot2-src-1.1/build/Desktop_Qt_6_9_3-Debug/src/OT2_autogen/include/ui_newpicdlgtemp.h:26: erreur : otpicturelistwidget.h: No such file or directory In file included from /home/alain/devel/ot2-src-1.1/build/Desktop_Qt_6_9_3-Debug/src/OT2_autogen/EWIEGA46WW/../../../../../src/otnewpicdlg.h:23, from /home/alain/devel/ot2-src-1.1/build/Desktop_Qt_6_9_3-Debug/src/OT2_autogen/EWIEGA46WW/moc_otnewpicdlg.cpp:9, from /home/alain/devel/ot2-src-1.1/build/Desktop_Qt_6_9_3-Debug/src/OT2_autogen/mocs_compilation.cpp:36: /home/alain/devel/ot2-src-1.1/build/Desktop_Qt_6_9_3-Debug/src/OT2_autogen/include/ui_newpicdlgtemp.h:26:10: fatal error: otpicturelistwidget.h: No such file or directory 26 | #include <otpicturelistwidget.h>though the file does exist in src.
What is wrong ? -
Hi all,
Still trying to port from Qt4 to Qt6.
From the advice of this post https://forum.qt.io/post/832681, I have rewritten the CMakelist.text# --- Sous-projet src --- cmake_minimum_required(VERSION 3.16) # Trouver Qt6 et ses modules nécessaires find_package(Qt6 REQUIRED COMPONENTS Widgets Sql Xml PrintSupport LinguistTools) qt_standard_project_setup() # --- Fichiers sources et ressources --- qt_add_executable(OT2 otmainwindow.cpp otutils.cpp otdbprefpane.cpp otapplication.cpp otprefwizard.cpp otpathprefpane.cpp otnavwidget.cpp otlistview.cpp otprefdlg.cpp otlistviewitem.cpp ottreesummary.cpp ottreeview.cpp otnewtreedlg.cpp otnewpicdlg.cpp otneweventdlg.cpp otindexedlistitem.cpp oteventsummary.cpp otpixlabelnodistort.cpp otpicsummary.cpp otpicview.cpp otpotsummary.cpp oteventview.cpp otpotview.cpp otnewpotdlg.cpp ot2.cpp ottreehistorytopwidget.cpp ottreehistoryview.cpp otabstractnavwidget.cpp otlinenavwidget.cpp otpicdisplay.cpp oteventdisplay.cpp otpothistoryview.cpp otpotevent.cpp otpothistorytopwidget.cpp otfullsizepicview.cpp otscalepicwidget.cpp otnewspeciesdlg.cpp otsetupwidget.cpp othomewidget.cpp otmanual.cpp otabout.cpp ottreehistorybotttomwidget.cpp ottableview.cpp otchoosedefaultpic.cpp othtmlexportdlg.cpp otmiscprefpane.cpp otabstracttableview.cpp otcheckbox.cpp oteventtable.cpp ottreetable.cpp otpicturetable.cpp otnewpicbox.cpp otpicturelistwidget.cpp oteditpicdlg.cpp otpottable.cpp otstyletable.cpp otsheetwidget.cpp otsheetlist.cpp otindexedaction.cpp otresizerobject.cpp otresizingthread.cpp otloadimagethread.cpp otpicupdateevent.cpp otupdatepothistoryevent.cpp otupdatetreehistoryevent.cpp oteventnavwidget.cpp ottreeevent.cpp otpothevent.cpp oteventdisplayview.cpp otexportcollectionwizard.cpp otecwizardpage1.cpp otecwizardpage2.cpp otimportcollectionwizard.cpp oticwizardpage1.cpp oticwizardpage2.cpp otresizingwizard.cpp otresizingpref.cpp dbprefpane.ui prefwizard.ui navwidget.ui mainwindow.ui newtreedlg.ui newpicdlgtemp.ui neweventdlg.ui newpotdlg.ui linenavwidget.ui editpicdlgtemp.ui eventnavwidget.ui ) set(RESOURCES ot2.qrc) # --- Gestion des traductions --- set(TRANSLATIONS ot2.french.ts ot2.german.ts ot2.dutch.ts ot2.spanish.ts ot2.japanese.ts ) qt_add_translation(QM_FILES ${TRANSLATIONS}) qt_add_resources(ot2.qrc) # --- Lien avec Qt --- target_link_libraries(OT2 PRIVATE Qt6::Widgets Qt6::Sql Qt6::Xml Qt6::PrintSupport )First problem :
/home/alain/devel/ot2-src-1.1/src/otpicview.h:23: erreur : otlistview.h: No such file or directory In file included from /home/alain/devel/ot2-src-1.1/src/otmainwindow.cpp:56: /home/alain/devel/ot2-src-1.1/src/otpicview.h:23:10: fatal error: otlistview.h: No such file or directory 23 | #include <otlistview.h> | ^~~~~~~~~~~~~~though :
ls otlistview* otlistview.cpp otlistview.h otlistviewitem.cpp otlistviewitem.hIn another place, I useI an ui file that uses a promoted Widget.
This widget and its header is confirgured in qtcreator (see pic)

but still, at compile time I get :/home/alain/devel/ot2-src-1.1/build/Desktop_Qt_6_9_3-Debug/src/OT2_autogen/include/ui_newpicdlgtemp.h:26: erreur : otpicturelistwidget.h: No such file or directory In file included from /home/alain/devel/ot2-src-1.1/build/Desktop_Qt_6_9_3-Debug/src/OT2_autogen/EWIEGA46WW/../../../../../src/otnewpicdlg.h:23, from /home/alain/devel/ot2-src-1.1/build/Desktop_Qt_6_9_3-Debug/src/OT2_autogen/EWIEGA46WW/moc_otnewpicdlg.cpp:9, from /home/alain/devel/ot2-src-1.1/build/Desktop_Qt_6_9_3-Debug/src/OT2_autogen/mocs_compilation.cpp:36: /home/alain/devel/ot2-src-1.1/build/Desktop_Qt_6_9_3-Debug/src/OT2_autogen/include/ui_newpicdlgtemp.h:26:10: fatal error: otpicturelistwidget.h: No such file or directory 26 | #include <otpicturelistwidget.h>though the file does exist in src.
What is wrong ?@lanigb
I don't know anything about cmake, but#include <otpicturelistwidget.h>You realise that
#include <>usually does not include looking in the same directory as the file it appears in, where#include ""would do so? You may have to include explicitly the directory where it lives in someINCLUDE-type environment variable or-Iargument to compiler.Could this be related to your error?
-
L lanigb referenced this topic on