Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Solved Fix for build error "member access into incomplete type 'const clang::FileEntry'"

    Installation and Deployment
    build error qtcreator building
    3
    10
    8681
    Loading More Posts
    • 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.
    • T
      TBRZ last edited by

      The fix:

      diff --git a/src/tools/clangrefactoringbackend/source/sourcelocationsutils.h b/src/tools/clangrefactoringbackend/source/sourcelocationsutils.h
      index 45bc71f..6304523 100644
      --- a/src/tools/clangrefactoringbackend/source/sourcelocationsutils.h
      +++ b/src/tools/clangrefactoringbackend/source/sourcelocationsutils.h
      @@ -30,6 +30,7 @@
       #include <sourcerangescontainer.h>
       
       #include <clang/Basic/SourceManager.h>
      +#include <clang/Basic/FileManager.h>
       #include <clang/Lex/Lexer.h>
       #include <llvm/Support/FileSystem.h>
       #include <llvm/Support/FileUtilities.h>
      

      The error:

      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.cpp:26:
      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.h:29:
      In file included from src/tools/clangrefactoringbackend/source/indexdataconsumer.h:32:
      In file included from src/tools/clangrefactoringbackend/source/symbolsvisitorbase.h:28:
      src/tools/clangrefactoringbackend/source/sourcelocationsutils.h:90:76: error: member access into incomplete type 'const clang::FileEntry'
              auto filePath = FilePath::fromNativeFilePath(absolutePath(fileEntry->getName()));
                                                                                 ^
      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.cpp:26:
      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.h:29:
      In file included from src/tools/clangrefactoringbackend/source/indexdataconsumer.h:32:
      In file included from src/tools/clangrefactoringbackend/source/symbolsvisitorbase.h:28:
      In file included from src/tools/clangrefactoringbackend/source/sourcelocationsutils.h:32:
      In file included from include/clang/Basic/SourceManager.h:37:
      In file included from include/clang/Basic/Diagnostic.h:19:
      include/clang/Basic/SourceLocation.h:356:7: note: forward declaration of 'clang::FileEntry'
      class FileEntry;
            ^
      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.cpp:26:
      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.h:29:
      In file included from src/tools/clangrefactoringbackend/source/indexdataconsumer.h:32:
      src/tools/clangrefactoringbackend/source/symbolsvisitorbase.h:66:36: error: member access into incomplete type 'const clang::FileEntry'
                  uint fileId = fileEntry->getUID();
                                         ^
      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.cpp:26:
      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.h:29:
      In file included from src/tools/clangrefactoringbackend/source/indexdataconsumer.h:32:
      In file included from src/tools/clangrefactoringbackend/source/symbolsvisitorbase.h:28:
      In file included from src/tools/clangrefactoringbackend/source/sourcelocationsutils.h:32:
      In file included from include/clang/Basic/SourceManager.h:37:
      In file included from include/clang/Basic/Diagnostic.h:19:
      include/clang/Basic/SourceLocation.h:356:7: note: forward declaration of 'clang::FileEntry'
      class FileEntry;
            ^
      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.cpp:26:
      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.h:29:
      In file included from src/tools/clangrefactoringbackend/source/indexdataconsumer.h:32:
      src/tools/clangrefactoringbackend/source/symbolsvisitorbase.h:76:38: error: member access into incomplete type 'const clang::FileEntry'
                  auto filePath = fileEntry->getName();
                                           ^
      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.cpp:26:
      In file included from src/tools/clangrefactoringbackend/source/collectsymbolsaction.h:29:
      In file included from src/tools/clangrefactoringbackend/source/indexdataconsumer.h:32:
      In file included from src/tools/clangrefactoringbackend/source/symbolsvisitorbase.h:28:
      In file included from src/tools/clangrefactoringbackend/source/sourcelocationsutils.h:32:
      In file included from include/clang/Basic/SourceManager.h:37:
      In file included from include/clang/Basic/Diagnostic.h:19:
      include/clang/Basic/SourceLocation.h:356:7: note: forward declaration of 'clang::FileEntry'
      class FileEntry;
            ^
      3 errors generated.
      

      Cheers!

      jsulm 1 Reply Last reply Reply Quote 0
      • T
        TBRZ @jsulm last edited by

        @jsulm https://bugreports.qt.io/browse/QTCREATORBUG-24537

        1 Reply Last reply Reply Quote 1
        • jsulm
          jsulm Lifetime Qt Champion @TBRZ last edited by

          @TBRZ In src/tools/clangrefactoringbackend/source/sourcelocationsutils.h you need to include header file containing FileEntry

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

          T 1 Reply Last reply Reply Quote 0
          • T
            TBRZ @jsulm last edited by

            @jsulm Hey, yes I'm aware of that. I didn't want to go through the pain of setting up accounts for such a minor diff.
            If possible please fix this in master.

            jsulm SGaist 2 Replies Last reply Reply Quote 0
            • jsulm
              jsulm Lifetime Qt Champion @TBRZ last edited by

              @TBRZ said in Fix for build error "member access into incomplete type 'const clang::FileEntry'":

              If possible please fix this in master.

              Please create a bug ticket in Qt bug tracker.

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

              T 1 Reply Last reply Reply Quote 0
              • T
                TBRZ @jsulm last edited by

                @jsulm I get internal error, maintenance messages and connection hanging up etc, when I open http://bugreports.qt.io/

                jsulm 1 Reply Last reply Reply Quote 0
                • jsulm
                  jsulm Lifetime Qt Champion @TBRZ last edited by

                  @TBRZ Try later then

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

                  T 1 Reply Last reply Reply Quote 0
                  • T
                    TBRZ @jsulm last edited by

                    @jsulm https://bugreports.qt.io/browse/QTCREATORBUG-24537

                    1 Reply Last reply Reply Quote 1
                    • SGaist
                      SGaist Lifetime Qt Champion @TBRZ last edited by

                      @TBRZ said in Fix for build error "member access into incomplete type 'const clang::FileEntry'":

                      @jsulm Hey, yes I'm aware of that. I didn't want to go through the pain of setting up accounts for such a minor diff.
                      If possible please fix this in master.

                      You already have an account :-)
                      You just need to send your patch to Gerrit :-)

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      T 1 Reply Last reply Reply Quote 0
                      • T
                        TBRZ @SGaist last edited by

                        @SGaist I appreciate the welcoming gesture. If I was not occupied with some deadlines, I'll definitely do so. But going through the wiki page for gerrit is daunting.

                        I came here for help about https://forum.qt.io/topic/118454/how-to-enable-clangrefactoring-and-clangpchmanager-plugin/1 and thought now that I'm here, I might as well notify the developers about a problem.

                        jsulm 1 Reply Last reply Reply Quote 0
                        • jsulm
                          jsulm Lifetime Qt Champion @TBRZ last edited by

                          @TBRZ said in Fix for build error "member access into incomplete type 'const clang::FileEntry'":

                          notify the developers about a problem

                          This is user forum. If you want to communicate with developers you should either use bug tracker or the mailing list.

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

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post