Delphi XE shows at least 200 errors but the program compiles just fine

后端 未结 6 795
被撕碎了的回忆
被撕碎了的回忆 2020-12-11 02:22

My brand new Delphi XE shows hundreds of errors in \'Structure\' panel. It shows errors like \'Undeclared FileExists at line 130\' or \'Undeclared Create at line 242\'. Even

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-11 03:24

    I have had the same errors before and i asked the same question, this was the reply: From another post:

    You did not make a mistake. The problem is that the there are three compilers in XE2 (like in previous versions of Delphi): the real compiler (which works fine), the Code Insight compiler (which is faster), the Error Insight compiler (which must be even more faster), and the syntax highlighting parser (which is the fastest).

    XE2 introduced a number of features that made the normal compiler slower, and gave the Code Insight and Error Insight compilers a bit of trouble. First of all, we have the new targets: Win32, Win64 and OSX which cause the search paths to be different for each target (see $PLATFORM directive), as well as build configuration, although there is only one "Library path" for each PLATFORM (and not for the build configurations).

    The second complexing factor is the dotted unit names (scoped unit names) that were introduced. Windows is no longer Windows, but Winapi.Windows.

    My guess is that these two additional complexing factors cause problems for the Code Insight and Error Insight compilers. Note that the real compiler still works. But the Error Insight shows incorrect errors, and the Code Insight doesn't always work for these units.

    You could try to explicitly add them to the project again (in which case the full path will be used, like you mention in your question on stack overflow as well).

    What I found out was:

    1. 99% of the errors are due to edited files not being save right (including references)
    2. If you add profiles Save your .dpr, .dproj, .pas, .dfm files (save unit, save project)
    3. If all fails a save + restart will usually fix it
    4. For older projects delete the .res file, it has botched paths, Delphi will recreate it.

    (Sorry for the bad initial post, Just got a Stackoverflow account, was not allowed to edit it. I hope this will suffice)

提交回复
热议问题