Delphi在库路径中找不到单位 [英] Delphi can't find units in the library path

查看:66
本文介绍了Delphi在库路径中找不到单位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了Delphi 10.1 Berlin,但是我遇到了库路径问题.在库路径中使用单元(至少是某些单元)时,Delphi找不到它们,并给出F2613错误,找不到XXX单元".

I've just installed Delphi 10.1 Berlin, and I've run into a problem with the library path. When using units in the library path (at least some), Delphi can't find them , and gives an F2613-error, "Unit XXX not found".

要设置一个非常简单的测试,我创建了一个名为"SampleUnit.pas"的单元,其中具有单个函数(求和),将文件放置在新创建的文件夹"C:\ TempLibrary"中,并添加了此文件夹到选项-> Delphi选项->库->库路径.我检查了几次拼写,而且我完全确定一切正确.然后,我制作了一个这样的控制台应用程序

To set up a very simple test, I created a unit called "SampleUnit.pas", with a single function (sum) in it, put the file in a newly created folder, "C:\TempLibrary", and added this folder to Options->Delphi Options->Library->Library path. I checked the spelling several times, and I am totally sure that everything is correct. I then made a console application like this

program Project1;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  SampleUnit;

begin
  writeln(Sum(12,13));
end.

并对其进行编译.繁荣,"[[dcc32致命错误] Project1.dpr(9):找不到F2613单元'SampleUnit'."

and compiled it. Boom, "[dcc32 Fatal Error] Project1.dpr(9): F2613 Unit 'SampleUnit' not found."

如果我用

uses
  SampleUnit in 'c:\templibrary\sampleunit.pas';

它工作正常.在项目搜索路径中添加"C:\ TempLibrary"也可以解决该问题.

it works just fine. Adding "C:\TempLibrary" to the projects search path will also solve the problem.

我想念什么?这已经在Delphi的早期版本中起作用,并且确实在柏林版本的其他安装中也起作用(我在虚拟机上有另一个安装,在这里工作得很好)

What am I missing? This has worked on previous versions of Delp and it does indeed work on other installations of the Berlin version as well (I have another installation on a virtual machine, where it works just fine)

我意识到这可能是我的设置存在的问题,其他人很难/不可能确定,但​​是如果任何人都可以对我应该看的地方提供任何见解,那就太好了.

I realize this might be a problem with my setup that may be hard/impossible for others to pinpoint, but if anyone can offer any insight as to where I should look that would be great.

更新:

问题已经解决,但是我不确定是什么原因解决了.我开始重新安装,并收到一条警告,说我的系统路径的长度接近该长度限制.我清理了系统路径(除去了对旧RAD Studio安装的引用),然后重新安装了Delphi 10.1 Berlin,现在一切又恢复了.

The problem has been solved, but I'm not sure excactly what solved it. I started a reinstall, and got a warning that said the length of my system path was close to the length limit. I cleaned the system path (removed references to old RAD studio installs among other things), then reinstalled Delphi 10.1 Berlin, and now everything works again.

推荐答案

似乎问题出在我的系统路径的长度上.我通过删除对早期Delphi版本的引用和一些其他过时的东西并重新安装了Delphi来缩短了它,现在一切都像以前一样工作.

It seems the problem was the length of my system path. I shortened it by removing references to earlier Delphi versions and some other obsolete stuff and reinstalled Delp and now everything works as before.

PS:在缩短了系统路径之后,我尝试在重新安装Delphi之前先构建测试项目,但这没有用.也许在安装过程中出现了问题,这可能是由于系统路径的长度引起的,也可能不是由于系统路径的长度引起的.我不能绝对确定地说是引起问题的系统路径,但它似乎是最有可能的候选人.

PS: After shortening my system path, I tried to build my test project before reinstalling Delp but that didn't work. Maybe something went wrong during the install, which may or may not have been caused by the length of the system path. I can't say with absolute certainty that it was the system path that caused the problem, but it seems the most likely candidate.

这篇关于Delphi在库路径中找不到单位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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