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. Include Header xxxxx.h is not used directly

Include Header xxxxx.h is not used directly

Scheduled Pinned Locked Moved Unsolved General and Desktop
c++
15 Posts 6 Posters 18.6k 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.
  • A andr
    2 Mar 2023, 07:12

    Could it be that there's another header called "system.h" than the one you expect is pulled from somewhere else? can you show your compiler command line (compile output pane)?

    I Offline
    I Offline
    Imman_Manny
    wrote on 2 Mar 2023, 07:16 last edited by
    #5

    @andr

    80bccd72-bd27-4103-b754-e3e64d7af212-image.png
    Kindly help bro .....

    J J 2 Replies Last reply 2 Mar 2023, 07:24
    0
    • I Imman_Manny
      2 Mar 2023, 07:16

      @andr

      80bccd72-bd27-4103-b754-e3e64d7af212-image.png
      Kindly help bro .....

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 2 Mar 2023, 07:24 last edited by
      #6

      @Imman_Manny There is a system system.h header file. I guess QtCreator thinks you're including that one, but not using. You should avoid using names for header files which are already used for system header files.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      I 1 Reply Last reply 2 Mar 2023, 08:16
      3
      • J jsulm
        2 Mar 2023, 07:24

        @Imman_Manny There is a system system.h header file. I guess QtCreator thinks you're including that one, but not using. You should avoid using names for header files which are already used for system header files.

        I Offline
        I Offline
        Imman_Manny
        wrote on 2 Mar 2023, 08:16 last edited by
        #7

        @jsulm 021df4c2-ca34-4475-a17e-8e00e28bc600-image.png

        I changed the Header name still error remains .

        J 1 Reply Last reply 2 Mar 2023, 08:21
        0
        • I Imman_Manny
          2 Mar 2023, 07:16

          @andr

          80bccd72-bd27-4103-b754-e3e64d7af212-image.png
          Kindly help bro .....

          J Offline
          J Offline
          JonB
          wrote on 2 Mar 2023, 08:18 last edited by
          #8

          @Imman_Manny
          You show you have a Sources > Controllers > system.cpp file. Do you even have a Headers > Controllers > system.h file? Otherwise as @jsulm says you might be best avoiding a system.h named file and possibly a system class.

          While we are on this one of my bug-bears about code written here by beginners. The C++ "standard" is for class names to begin with an uppercase letter, and Qt observes that everywhere. Why people then choose to write classes with lowercase first character is quite beyond me, it goes against convention and makes code harder to read. I would not recommend "system" as a class name, but if you do why in the world don't you make it System?

          1 Reply Last reply
          0
          • I Imman_Manny
            2 Mar 2023, 08:16

            @jsulm 021df4c2-ca34-4475-a17e-8e00e28bc600-image.png

            I changed the Header name still error remains .

            J Offline
            J Offline
            JonB
            wrote on 2 Mar 2023, 08:21 last edited by
            #9

            @Imman_Manny said in Include Header xxxxx.h is not used directly:

            I changed the Header name still error remains .

            Now that you have changed off it being named system.h. I am not sure what that IDE message is trying to tell you here. It says "fix available", if you click on that or try Alt+Enter or whatever it is that "applies" the suggested fix, what is it that the IDE changes in your code?

            I 1 Reply Last reply 2 Mar 2023, 08:40
            0
            • J JonB
              2 Mar 2023, 08:21

              @Imman_Manny said in Include Header xxxxx.h is not used directly:

              I changed the Header name still error remains .

              Now that you have changed off it being named system.h. I am not sure what that IDE message is trying to tell you here. It says "fix available", if you click on that or try Alt+Enter or whatever it is that "applies" the suggested fix, what is it that the IDE changes in your code?

              I Offline
              I Offline
              Imman_Manny
              wrote on 2 Mar 2023, 08:40 last edited by
              #10

              @JonB its remove the Include LoL. really dont have clue .Help
              66841996-e09d-4b04-9f96-1a64506a1853-image.png

              J 1 Reply Last reply 2 Mar 2023, 08:57
              0
              • I Imman_Manny
                2 Mar 2023, 08:40

                @JonB its remove the Include LoL. really dont have clue .Help
                66841996-e09d-4b04-9f96-1a64506a1853-image.png

                J Offline
                J Offline
                JonB
                wrote on 2 Mar 2023, 08:57 last edited by JonB 3 Feb 2023, 08:58
                #11

                @Imman_Manny
                Now class system is undefined. Presumably it is declared in onesystem.h? Put the #include "onesystem.h" back in, and if the IDE still complains ignore it. Try compiling your code and verify that works.

                I 1 Reply Last reply 2 Mar 2023, 10:18
                0
                • J JonB
                  2 Mar 2023, 08:57

                  @Imman_Manny
                  Now class system is undefined. Presumably it is declared in onesystem.h? Put the #include "onesystem.h" back in, and if the IDE still complains ignore it. Try compiling your code and verify that works.

                  I Offline
                  I Offline
                  Imman_Manny
                  wrote on 2 Mar 2023, 10:18 last edited by
                  #12

                  @JonB

                  Bro .. actually i need your help for another Task

                  1. I have multiple qml file (converted from svg Drawing )
                  2. I want to list like grid view but its in different size .
                  3. And If OnDoubleclicked it should be fit to the screen.

                  Please give me some tips to try.

                  J 1 Reply Last reply 2 Mar 2023, 10:21
                  0
                  • I Imman_Manny
                    2 Mar 2023, 10:18

                    @JonB

                    Bro .. actually i need your help for another Task

                    1. I have multiple qml file (converted from svg Drawing )
                    2. I want to list like grid view but its in different size .
                    3. And If OnDoubleclicked it should be fit to the screen.

                    Please give me some tips to try.

                    J Offline
                    J Offline
                    JonB
                    wrote on 2 Mar 2023, 10:21 last edited by
                    #13

                    @Imman_Manny
                    Then ask a new question, presumably in the QML sub-forum. You don't want my help because I have never used QML.

                    1 Reply Last reply
                    0
                    • osirisgothraO Offline
                      osirisgothraO Offline
                      osirisgothra
                      wrote on 26 Nov 2024, 01:46 last edited by
                      #14

                      false positives for this are so common, it doesn't look like it actually will look past includes that include macros that refer to other symbols in the same subset, this was the case with ncurses, which (unfortunately) loves to declare function-macros (or 'funcros'). My ballpark is that they are expanding the macro, and the since the end result is technically not in the same file, but deeper in, it is missed altogether.

                      Funny how it fails the minute you remove the #include... its almost comical :p

                      I'm truly glad you r/offmychess t finally, but please don't go too far, because you r/beyondvoxels and that implies that u r/donewithlife. Oh well time to git back to the lab, because azure sea here, I have a lot of work to do...

                      Christian EhrlicherC 1 Reply Last reply 26 Nov 2024, 05:36
                      0
                      • osirisgothraO osirisgothra
                        26 Nov 2024, 01:46

                        false positives for this are so common, it doesn't look like it actually will look past includes that include macros that refer to other symbols in the same subset, this was the case with ncurses, which (unfortunately) loves to declare function-macros (or 'funcros'). My ballpark is that they are expanding the macro, and the since the end result is technically not in the same file, but deeper in, it is missed altogether.

                        Funny how it fails the minute you remove the #include... its almost comical :p

                        Christian EhrlicherC Offline
                        Christian EhrlicherC Offline
                        Christian Ehrlicher
                        Lifetime Qt Champion
                        wrote on 26 Nov 2024, 05:36 last edited by
                        #15

                        @osirisgothra this is a last warning - stop reviving old posts.

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

                        1 Reply Last reply
                        0

                        • Login

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