Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. In #include hell - where is my error ?
Qt 6.11 is out! See what's new in the release blog

In #include hell - where is my error ?

Scheduled Pinned Locked Moved Unsolved C++ Gurus
12 Posts 6 Posters 2.2k Views 4 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    All other #includes pass by intelisense , except "EXAMPLES_COPY.."
    Is it possible there is a conflict between "examples" ( works) and "EXAMPLES..." do not work ?
    If my "EXAMPLES..." folder is wrong / missing (?) , should I get more /different errors?

    5658a1db-64ed-4b54-a23e-d843ab6b577b-image.png

    Help / suggestions would be appreciated.

    ODБOïO 1 Reply Last reply
    0
    • A Anonymous_Banned275

      All other #includes pass by intelisense , except "EXAMPLES_COPY.."
      Is it possible there is a conflict between "examples" ( works) and "EXAMPLES..." do not work ?
      If my "EXAMPLES..." folder is wrong / missing (?) , should I get more /different errors?

      5658a1db-64ed-4b54-a23e-d843ab6b577b-image.png

      Help / suggestions would be appreciated.

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2

      @AnneRanch said in In #include hell - where is my error ?:

      All other #includes pass by intelisense

      Are you sure ? line 41 there is an error saying
      expected "FILENAME" or <FILENAME>

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by
        #3

        That error is a result of incomplete #include .
        Actually I expected to have something like this
        #include "../../EXAMPLES_COPY... to be valid but I never get the "EXAMPLES_COPY " as an options.
        That tells me intelisense does not see the folder as valid , hence my error I cannot solve since I get no other error and the folder is added same as others.
        I am not sure how to prove that or how to add anther "EXAMPLES_COPY... reference.

        1 Reply Last reply
        0
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #4

          What folder are you in (just for us to understand the relative path)?
          As pointed out by @ODБOï , did you fix the missing closing " on line 41?

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          A 1 Reply Last reply
          0
          • VRoninV VRonin

            What folder are you in (just for us to understand the relative path)?
            As pointed out by @ODБOï , did you fix the missing closing " on line 41?

            A Offline
            A Offline
            Anonymous_Banned275
            wrote on last edited by
            #5

            @VRonin IN same folder as the other #includes - which works.
            Yes, the line #41 is incomplete code - not an issue.

            Again - it the folder selection is wrong - should I get some other error?
            The folder is referenceed in all three parts of the project - headers . source and forms.

            1 Reply Last reply
            0
            • Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Apart from the very stupid way on including headers of other libs - there is a space between the h and the " at the front and end in line 42

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

              A 1 Reply Last reply
              2
              • Christian EhrlicherC Christian Ehrlicher

                Apart from the very stupid way on including headers of other libs - there is a space between the h and the " at the front and end in line 42

                A Offline
                A Offline
                Anonymous_Banned275
                wrote on last edited by
                #7

                @Christian-Ehrlicher Even with the space removed - intelisese does not give option EXAMPLES_COPY , but both CAT and Examples are OK.

                PS I am willing to listen to your "smart way" to use include AFTER this is solved. So far doing it smarter does not lead to solution.

                HoMaH 1 Reply Last reply
                0
                • Christian EhrlicherC Offline
                  Christian EhrlicherC Offline
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by Christian Ehrlicher
                  #8

                  @AnneRanch said in In #include hell - where is my error ?:

                  So far doing it smarter does not lead to solution.

                  it's not smarter - you simply did it wrong. There path must be correct and yours was obviously not since I doubt you created a file named chat.h with a trailing space.

                  And since it's your harddisk you should know where to find your include files, we can't.

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

                  A 1 Reply Last reply
                  1
                  • Christian EhrlicherC Christian Ehrlicher

                    @AnneRanch said in In #include hell - where is my error ?:

                    So far doing it smarter does not lead to solution.

                    it's not smarter - you simply did it wrong. There path must be correct and yours was obviously not since I doubt you created a file named chat.h with a trailing space.

                    And since it's your harddisk you should know where to find your include files, we can't.

                    A Offline
                    A Offline
                    Anonymous_Banned275
                    wrote on last edited by
                    #9

                    @Christian-Ehrlicher Perhaps your troubleshooting philosophy is different then mine - and that is OK.
                    I usually start at the beginning and not at the end.
                    And double checking the instructions is my favorite too.
                    The space after the header is odd, but the problem is - and said it multiple times - inteliisese does not "SEE " the EXAMPLES_COPY folder at all.

                    So the problem is bypassed, for now, by providing full path to the headers.
                    Let's put it on back burner for now.

                    PS
                    And since it's your harddisk you should know where to find your include files, we can't.

                    And since I am not sure who "we " are - you ( plural ) have as much info as "we / us ".

                    1 Reply Last reply
                    0
                    • Kent-DorfmanK Offline
                      Kent-DorfmanK Offline
                      Kent-Dorfman
                      wrote on last edited by Kent-Dorfman
                      #10

                      Personally I'd shun anyone who used paths with embedded spaces in any C++ development, or who added long direct path includes in source instead of using the INCLUDE macros correctly.

                      NEVER NEVER NEVER...and did I mention NEVER? should you use backwards relative or any explicit and absolute paths in your #include.

                      use INCLUDE={path}:{path} or c++ -I{path} to locate include paths on a different branch than the compilation unit. Let the build system do the heavy lifting and dont eve make your code nonportable by hardcoding include directories.

                      The dystopian literature that served as a warning in my youth has become an instruction manual in my elder years.

                      A 1 Reply Last reply
                      1
                      • Kent-DorfmanK Kent-Dorfman

                        Personally I'd shun anyone who used paths with embedded spaces in any C++ development, or who added long direct path includes in source instead of using the INCLUDE macros correctly.

                        NEVER NEVER NEVER...and did I mention NEVER? should you use backwards relative or any explicit and absolute paths in your #include.

                        use INCLUDE={path}:{path} or c++ -I{path} to locate include paths on a different branch than the compilation unit. Let the build system do the heavy lifting and dont eve make your code nonportable by hardcoding include directories.

                        A Offline
                        A Offline
                        Anonymous_Banned275
                        wrote on last edited by
                        #11

                        @Kent-Dorfman So why do not you practice what you preach?
                        Your comments are not helping to solve the problem. Give it a rest.

                        1 Reply Last reply
                        0
                        • A Anonymous_Banned275

                          @Christian-Ehrlicher Even with the space removed - intelisese does not give option EXAMPLES_COPY , but both CAT and Examples are OK.

                          PS I am willing to listen to your "smart way" to use include AFTER this is solved. So far doing it smarter does not lead to solution.

                          HoMaH Offline
                          HoMaH Offline
                          HoMa
                          wrote on last edited by
                          #12

                          @AnneRanch actually there is another wrongly placed space: at the beginning before the

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