Delphi XE2后台IDE编译器无法找到源路径 [英] Delphi XE2 background IDE compiler unable to find source path

查看:202
本文介绍了Delphi XE2后台IDE编译器无法找到源路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚买了XE2版本,安装了更新1 ISO,并用它编译了我的开源项目。 p>

其实:




  • 我将库的源代码路径添加到了一般设置IDE(对于我使用的所有平台,即Windows 32位和64位到目前为止);

  • 我编译了 TestSQLite3.dpr 我们的框架的回归测试 - 没问题:EXE被编译并且所有测试都通过了;

  • 我有一个奇怪的问题与IDE后台编译器:即使项目编译,IDE显示关于未知文件的一些错误(不在底层编译器消息,但在顶部的类导航树中 - 留给源代码编辑器),而在.dpr源代码中,单元名称以红色加下划线, m无法在源代码中导航(使用Ctrl +单击符号)。



我添加了源代码路径图书馆t o项目选项(对于Win32 / Win64 - 即使已经设置在全局IDE级别)。现在关于未知文件的错误消失了,但单位名称在源代码中仍然以红色表示,并且Ctrl + Click不起作用。



TestSQLite3.dpr 源代码不指定单位的完整路径:

 使用
{$ I SynDprUses.inc}
Windows,
消息,
SysUtils,
类,
SynCrypto,
SynCrtSock,
SynCommons,
SynDB,
SynOleDB,
SynDBOracle,
(...)

在上述行中,SynCrypto,SynCrtSock,SynCommons以红色加下划线。



我的实际猜测是在.dpr( SynCrypto在..\SynCrypto.pas中需要完整的路径')。我没有测试,因为我没有XE2在工作。



由于以前的IDE没有问题与这种源代码(它工作从德尔福6到XE),我想知道是否有回归的可能性,或者一个新的选项不可用于以前版本的IDE(可能是基于平台),我没有正确设置。或者也可能在.dpr中需要完整的路径 - 但这听起来像是Code / Error Insight编译器对我的回归。

解决方案

我问这个问题, Bob博士(由我购买了XE2许可证) - 自1 $ = 1€方程听起来有点不公平,我至少要有一个真正的德尔福专家作为我的经销商)。



这是他的答案:


你没有犯错误。问题是XE2中有三个
编译器(像以前的Delphi版本):真正的
编译器(它的工作正常),Code Insight编译器(这是
更快) ,Error Insight编译器(必须更快),
和语法突出显示解析器(最快)。



XE2引入了一些使正常编译器
更慢的功能,并给了Code Insight和Error Insight编译器一些
的麻烦。首先,我们有新的目标:Win32,Win64和OSX
,导致每个目标的搜索路径不同(请参阅
$ PLATFORM指令),以及构建配置,尽管有
对于每个PLATFORM(而不是构建
配置)只有一个库路径。



第二个复杂因素是引入的虚线单位名称(范围单位
名称)。 Windows不再是Windows,但
Winapi.Windows。



我猜测这两个额外的复杂因素会导致Code Insight和Error Insight编译器出现
问题。注意,
真正的编译器仍然有效。但是,Error Insight显示错误的
错误,而Code Insight并不总是适用于这些单元。



您可以尝试将其重新显式添加到项目中(其中
将使用完整路径,就像您在$ b中提到的问题一样) $ b堆栈溢出)。


所以我恐怕这是一些回归...



在关闭问题编辑:



首先,添加完整路径:

  SynPdf in'..\SynPdf.pas',

$ b $ .dpr中的b

确实让文件被发现 - 但后台编译器仍然丢失,无法在本体中找到类声明。



只是另一个回归样本:

  var Thread:array [0..3] of integer; 
句柄:array [0..high(Thread)] of integer;

是一个非常安全的语法,编译很好,由以前的Error Insight编译器解释,没有任何问题(从Delphi 5开始工作),但在XE2下失败。



我对XE2 IDE有些失望。编译器使其工作。但IDE真的令人失望。从我的角度来看,这是不可用的。我将继续使用Delphi 7作为主编辑器,只使用XE2作为跨平台编译器和调试器。


I just bought XE2 version, installed the update 1 ISO, and made my Open Source projects compile with it.

In fact:

  • I added the source code paths of the library to the general settings IDE (for all platforms I use, i.e. Windows 32 bit and 64 bit up to now);
  • I compiled the TestSQLite3.dpr regression tests of our framework - no problem: EXE is compiled and all tests passed;
  • I've a strange issue with the IDE background compilers: even if the project compiled, the IDE displays some errors about unknown files (not in the bottom compiler messages, but in the top of the classes navigation tree - left to the source code editor), and in the .dpr source code, the unit names are underlined in red, and I'm not able to navigate inside the source (using Ctrl+Click on a symbol).

I've added the source code paths of the library to the project options (for Win32/Win64 - even if it was already set at the global IDE level). Now the errors about unknown files disappeared, but the unit names are still underlined in red in the source code, and the Ctrl+Click does not work.

The TestSQLite3.dpr source code do not specify the full path of the units:

uses
  {$I SynDprUses.inc}
  Windows,
  Messages,
  SysUtils,
  Classes,
  SynCrypto,
  SynCrtSock,
  SynCommons,
  SynDB,
  SynOleDB,
  SynDBOracle,
  (...)

In the above lines, SynCrypto, SynCrtSock, SynCommons are underlined in red.

My actual guess is that full paths are needed in the .dpr (SynCrypto in '..\SynCrypto.pas'). I did not test this because I don't have XE2 at work.

Since there was no issue with the previous IDE with this kind of source code (it worked from Delphi 6 up to XE), I wonder if there is a possibility of regression, or a new option not available with the previous version of the IDE (probably platform-based) which I did not set properly. Or perhaps the full path is now needed in .dpr - but this sounds like a regression in the Code/Error Insight compiler to me.

解决方案

I asked the question to Dr Bob (by whom I bought the XE2 license - since the 1 $ = 1 € equation sounded a bit unfair, I wanted at least to have a real Delphi expert for being my reseller).

Here is his answer:

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

So I'm afraid this is some regression...

Edit at closing question:

First point is that adding full paths:

  SynPdf in '..\SynPdf.pas',

in the .dpr did let the files been found - but the background compiler is still lost, unable to find a class declaration in this body.

Just another regression sample:

   var Thread: array[0..3] of integer; 
       Handle: array[0..high(Thread)] of integer;

Is a perfectly safe syntax, compiles just fine, was interpreted by the previous Error Insight compiler without any problems (works since Delphi 5), but fails under XE2.

I'm a bit disappointed about XE2 IDE. Compiler makes it work. But IDE is really disappointing. It is not usable, from my point of view. I'll continue using Delphi 7 as my main editor, and just use XE2 as cross-platform compiler and debugger.

这篇关于Delphi XE2后台IDE编译器无法找到源路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆