Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Headers not found

Headers not found

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 192 Views 1 Watching
  • 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.
  • L Offline
    L Offline
    lanigb
    wrote on last edited by
    #1

    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.h
    

    In another place, I useI an ui file that uses a promoted Widget.
    This widget and its header is confirgured in qtcreator (see pic)
    qt.jpg
    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 ?

    JonBJ 1 Reply Last reply
    0
    • L lanigb

      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.h
      

      In another place, I useI an ui file that uses a promoted Widget.
      This widget and its header is confirgured in qtcreator (see pic)
      qt.jpg
      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 ?

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

      @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 some INCLUDE-type environment variable or -I argument to compiler.

      Could this be related to your error?

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lanigb
        wrote on last edited by
        #3

        Thanks for the remark. I'll try this way, and by the way, the first error was in fact trivial to correct, I feel ashamed not to have noticed.

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lanigb
          wrote on last edited by
          #4

          Seems to be solved by set(CMAKE_INCLUDE_CURRENT_DIR ON) but not quite sure (I have other errors). Why the ui compiler would include with < and < instead of " " ?

          1 Reply Last reply
          0
          • L lanigb referenced this topic on

          • Login

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