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. fatal error: QColor: No such file or directory
Forum Updated to NodeBB v4.3 + New Features

fatal error: QColor: No such file or directory

Scheduled Pinned Locked Moved Solved General and Desktop
33 Posts 6 Posters 4.6k 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.
  • SPlattenS SPlatten

    This post is deleted!

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

    @SPlatten

    I have added a header to the project that starts off with:

    ./../include/ASVscm/services/vehicle/dataMgmt.H:13:10: fatal error: QColor: No such file or directory

    And is that the file into which you have added your #include <QColor>? Since you do not say we do not know....

    Start by putting a #include <QColor> directly into one of your local .cpp or .h files in the current folder and trying to compile (without that bad .h file). Does that work or error? Then we know whether it is somehow to do with the dataMgmt.H file or not....

    SPlattenS 1 Reply Last reply
    0
    • JonBJ JonB

      @SPlatten

      I have added a header to the project that starts off with:

      ./../include/ASVscm/services/vehicle/dataMgmt.H:13:10: fatal error: QColor: No such file or directory

      And is that the file into which you have added your #include <QColor>? Since you do not say we do not know....

      Start by putting a #include <QColor> directly into one of your local .cpp or .h files in the current folder and trying to compile (without that bad .h file). Does that work or error? Then we know whether it is somehow to do with the dataMgmt.H file or not....

      SPlattenS Offline
      SPlattenS Offline
      SPlatten
      wrote on last edited by
      #11
      This post is deleted!
      JonBJ 1 Reply Last reply
      0
      • SPlattenS SPlatten

        This post is deleted!

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

        @SPlatten
        And what have you done about the suggestion?

        SPlattenS 2 Replies Last reply
        0
        • JonBJ JonB

          @SPlatten
          And what have you done about the suggestion?

          SPlattenS Offline
          SPlattenS Offline
          SPlatten
          wrote on last edited by
          #13
          This post is deleted!
          1 Reply Last reply
          0
          • JonBJ JonB

            @SPlatten
            And what have you done about the suggestion?

            SPlattenS Offline
            SPlattenS Offline
            SPlatten
            wrote on last edited by
            #14

            @JonB , same result:

            client.C:11:10: fatal error: QColor: No such file or directory
             #include <QColor>
                      ^~~~~~~~
            compilation terminate
            
            JonBJ jsulmJ 2 Replies Last reply
            0
            • SPlattenS SPlatten

              @JonB , same result:

              client.C:11:10: fatal error: QColor: No such file or directory
               #include <QColor>
                        ^~~~~~~~
              compilation terminate
              
              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #15

              @SPlatten
              So maybe you do not have the necessary files in the Qt installation area, or it's using a different Qt installation area from what you think it should....

              • Try different #include <...> statements using something else than QColor. Is it QColor only, or are others not found?
              • Create a brand new, standalone, tiny project, not the whole project you are using now. Does it work or fail there?
              SPlattenS 1 Reply Last reply
              0
              • SPlattenS SPlatten

                @JonB , same result:

                client.C:11:10: fatal error: QColor: No such file or directory
                 #include <QColor>
                          ^~~~~~~~
                compilation terminate
                
                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #16

                @SPlatten How did you install Qt and are you sure you use Qt version you want to?

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

                SPlattenS 1 Reply Last reply
                0
                • JonBJ JonB

                  @SPlatten
                  So maybe you do not have the necessary files in the Qt installation area, or it's using a different Qt installation area from what you think it should....

                  • Try different #include <...> statements using something else than QColor. Is it QColor only, or are others not found?
                  • Create a brand new, standalone, tiny project, not the whole project you are using now. Does it work or fail there?
                  SPlattenS Offline
                  SPlattenS Offline
                  SPlatten
                  wrote on last edited by
                  #17

                  @JonB , the structure of this project contains many sub-projects each with they're own .pro files. I've search all the projects for the same inclusion:

                  grep -Rnw ./ -e "#include <QColor>"
                  

                  And I have found other instances, then checked the .pro content for these and they don't appear to be any different.

                  I know this isn't logical, if I go to the local directory containing the .pro for the project I'm having difficulty with and execute:

                  make clean
                  make depend
                  make
                  

                  It builds with no errors, its the same process from the parent that is when I get the error.

                  JonBJ J.HilkJ 2 Replies Last reply
                  0
                  • jsulmJ jsulm

                    @SPlatten How did you install Qt and are you sure you use Qt version you want to?

                    SPlattenS Offline
                    SPlattenS Offline
                    SPlatten
                    wrote on last edited by
                    #18

                    @jsulm , unfortunately thats completely out of my control, the laptop I'm using is supplied by my client, installed with RedHat 7.2 and Qt, the version of Qt is specific to the project.

                    1 Reply Last reply
                    0
                    • SPlattenS SPlatten

                      @JonB , the structure of this project contains many sub-projects each with they're own .pro files. I've search all the projects for the same inclusion:

                      grep -Rnw ./ -e "#include <QColor>"
                      

                      And I have found other instances, then checked the .pro content for these and they don't appear to be any different.

                      I know this isn't logical, if I go to the local directory containing the .pro for the project I'm having difficulty with and execute:

                      make clean
                      make depend
                      make
                      

                      It builds with no errors, its the same process from the parent that is when I get the error.

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

                      @SPlatten said in fatal error: QColor: No such file or directory:

                      And I have found other instances, then checked the .pro content for these and they don't appear to be any different.

                      Please explain things clearly! "don't appear to be any different." might mean they have the same line and they (a) do work without the error or (b) do not work and show the same error .....

                      Anyway, I can only suggest you discover the exact compilation command-line being used. #include <...> should only look in system directories. Are these somehow different for the faulting case, that is all I can think of.

                      SPlattenS 1 Reply Last reply
                      0
                      • JonBJ JonB

                        @SPlatten said in fatal error: QColor: No such file or directory:

                        And I have found other instances, then checked the .pro content for these and they don't appear to be any different.

                        Please explain things clearly! "don't appear to be any different." might mean they have the same line and they (a) do work without the error or (b) do not work and show the same error .....

                        Anyway, I can only suggest you discover the exact compilation command-line being used. #include <...> should only look in system directories. Are these somehow different for the faulting case, that is all I can think of.

                        SPlattenS Offline
                        SPlattenS Offline
                        SPlatten
                        wrote on last edited by
                        #20

                        @JonB , I used grep to find the same include in other projects that do compile without error:

                        grep -Rnw ./ -e "#include <QColor>"
                        

                        I then looked at the .pro file. I cannot see anything that I have done differently.

                        1 Reply Last reply
                        0
                        • kkoehneK Offline
                          kkoehneK Offline
                          kkoehne
                          Moderators
                          wrote on last edited by
                          #21

                          Can you show the full command line for the compiler call that fails?

                          Director R&D, The Qt Company

                          SPlattenS 1 Reply Last reply
                          0
                          • kkoehneK kkoehne

                            Can you show the full command line for the compiler call that fails?

                            SPlattenS Offline
                            SPlattenS Offline
                            SPlatten
                            wrote on last edited by
                            #22
                            This post is deleted!
                            JonBJ 1 Reply Last reply
                            0
                            • SPlattenS SPlatten

                              This post is deleted!

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

                              @SPlatten said in fatal error: QColor: No such file or directory:

                              -I/usr/include/qt5 -I/usr/include/qt5/QtNetwork -I/usr/include/qt5/QtCore

                              Are these the directories where Qt's include files including for QColor are located?
                              How does this command line compare against one issued for a file which does find <QColor>?

                              SPlattenS 1 Reply Last reply
                              0
                              • hskoglundH Offline
                                hskoglundH Offline
                                hskoglund
                                wrote on last edited by
                                #24

                                Also in addition to @JonB's questions:
                                if you try including another file in the same directory, say:
                                #include <QIcon>
                                do you get the same error for that file?
                                Also what happens if you try compiling a .cpp file instead of a .c file?

                                JonBJ 1 Reply Last reply
                                0
                                • SPlattenS SPlatten

                                  @JonB , the structure of this project contains many sub-projects each with they're own .pro files. I've search all the projects for the same inclusion:

                                  grep -Rnw ./ -e "#include <QColor>"
                                  

                                  And I have found other instances, then checked the .pro content for these and they don't appear to be any different.

                                  I know this isn't logical, if I go to the local directory containing the .pro for the project I'm having difficulty with and execute:

                                  make clean
                                  make depend
                                  make
                                  

                                  It builds with no errors, its the same process from the parent that is when I get the error.

                                  J.HilkJ Offline
                                  J.HilkJ Offline
                                  J.Hilk
                                  Moderators
                                  wrote on last edited by
                                  #25

                                  @SPlatten are you sure, that the subproject has this header marked as HEADER in the pro file ?


                                  Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                                  Q: What's that?
                                  A: It's blue light.
                                  Q: What does it do?
                                  A: It turns blue.

                                  SPlattenS 1 Reply Last reply
                                  0
                                  • J.HilkJ J.Hilk

                                    @SPlatten are you sure, that the subproject has this header marked as HEADER in the pro file ?

                                    SPlattenS Offline
                                    SPlattenS Offline
                                    SPlatten
                                    wrote on last edited by
                                    #26
                                    This post is deleted!
                                    1 Reply Last reply
                                    0
                                    • hskoglundH hskoglund

                                      Also in addition to @JonB's questions:
                                      if you try including another file in the same directory, say:
                                      #include <QIcon>
                                      do you get the same error for that file?
                                      Also what happens if you try compiling a .cpp file instead of a .c file?

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

                                      @hskoglund said in fatal error: QColor: No such file or directory:

                                      Also in addition to @JonB's questions:
                                      if you try including another file in the same directory, say:
                                      #include <QIcon>

                                      I asked the OP to do just this earlier on...!

                                      SPlattenS 1 Reply Last reply
                                      0
                                      • JonBJ JonB

                                        @SPlatten said in fatal error: QColor: No such file or directory:

                                        -I/usr/include/qt5 -I/usr/include/qt5/QtNetwork -I/usr/include/qt5/QtCore

                                        Are these the directories where Qt's include files including for QColor are located?
                                        How does this command line compare against one issued for a file which does find <QColor>?

                                        SPlattenS Offline
                                        SPlattenS Offline
                                        SPlatten
                                        wrote on last edited by
                                        #28

                                        @JonB , why would one project find it and another doesn't?

                                        jsulmJ 1 Reply Last reply
                                        0
                                        • JonBJ JonB

                                          @hskoglund said in fatal error: QColor: No such file or directory:

                                          Also in addition to @JonB's questions:
                                          if you try including another file in the same directory, say:
                                          #include <QIcon>

                                          I asked the OP to do just this earlier on...!

                                          SPlattenS Offline
                                          SPlattenS Offline
                                          SPlatten
                                          wrote on last edited by SPlatten
                                          #29

                                          @JonB , QObject is included and that isn't a problem

                                          [Edit] More specifics: The project build structure:

                                          Top level .pro A
                                            sub-projects B
                                             more-sub-projects C
                                          

                                          If I go to level C and build the project compiles without error, however at level B it does have the error, there is a pro file at each level.

                                          JonBJ 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