简体   繁体   English

找不到文件xxxxx.dcu

[英]File not found xxxxx.dcu

I'm trying to locate which unit in my app uses a specific .dcu . 我正在尝试查找应用程序中哪个单元使用特定的.dcu。 As i don't know which unit is, i've renamed the dcu to generate an exception in compiler-time : 由于我不知道哪个单元,我已将dcu重命名为在编译时生成异常:

[DCC Error] F1026 - File not found 'IdThread.dcu' [DCC错误] F1026-找不到文件'IdThread.dcu'

Is there a way to locate in my project the unit using this file ? 有没有办法使用此文件在我的项目中找到单元? I know it's an Indy related unit, but in my project i don't have ANY Indy components ! 我知道这是一个与Indy相关的部门,但是在我的项目中,我没有任何Indy组件!

As a last resort, you can use a grep-like tool to search within the DCUs themselves: eg Using the build in windows findstr command: 作为最后的选择,您可以使用类似grep的工具在DCU自身中进行搜索:例如,使用Windows中的内置findstr命令:

findstr /ism "\<idthread\>" *.dcu

ObscureUnit.dcu
IdScheduler.dcu

will list any DCUs with a reference to IdThread. 将列出所有引用IdThread的DCU。 You may need to check in the library path as well as a unit you only have in compiled format may have a reference. 您可能需要检入库路径以及仅以编译格式拥有的单元才能获得参考。

Of course, IdThread may be used in a unit that is used by another unit that your project uses. 当然,IdThread可以在您的项目使用的另一个单元使用的单元中使用。 You may need to perform this operation recursively. 您可能需要递归执行此操作。

NOTE: This may not work on a Unicode version of Delphi, as findstr doesn't support Unicode, and I'm not sure if the reference in the dcu uses Unicode. 注意:这可能不适用于Unicode版本的Delphi,因为findstr不支持Unicode,而且我不确定dcu中的引用是否使用Unicode。 If it does, use a Unicode enabled version of grep, or use the SysInternals Strings utility to extract the "readable" text from the dcu files. 如果是这样,请使用启用Unicode的grep版本,或使用SysInternals Strings实用程序从dcu文件中提取“可读”文本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM