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 5.2k 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.
  • 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 Online
            hskoglundH Online
            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
                      • SPlattenS SPlatten

                        @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 Offline
                        JonBJ Offline
                        JonB
                        wrote on last edited by
                        #30

                        @SPlatten
                        And did you compare the command-lines issued at working vs non-working levels for a clue?

                        1 Reply Last reply
                        0
                        • SPlattenS SPlatten

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

                          jsulmJ Offline
                          jsulmJ Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on last edited by
                          #31

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

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

                          Because those are two different projects with own pro files if I understood you correctly.
                          If you use subdirs project type then add "QT += gui" in the subprojects pro files where QColor is included (directly or via other header files).

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

                          JonBJ SPlattenS 2 Replies Last reply
                          2
                          • jsulmJ jsulm

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

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

                            Because those are two different projects with own pro files if I understood you correctly.
                            If you use subdirs project type then add "QT += gui" in the subprojects pro files where QColor is included (directly or via other header files).

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

                            @jsulm I suspect you have hit the nail on the head....!

                            1 Reply Last reply
                            0
                            • jsulmJ jsulm

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

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

                              Because those are two different projects with own pro files if I understood you correctly.
                              If you use subdirs project type then add "QT += gui" in the subprojects pro files where QColor is included (directly or via other header files).

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

                              @jsulm , I've moved on now, by ditching the header and reference to QColor.

                              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