Delphi搜索路径与库路径vs浏览路径 [英] Delphi Search path vs Library Path vs Browsing Path

查看:1027
本文介绍了Delphi搜索路径与库路径vs浏览路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Delphi中,我可以通过将文件夹的源代码添加到项目搜索路径或将其添加到库路径中来包含文件夹的源代码。搜索路径仅适用于当前项目,而库路径适用于使用IDE打开的任何项目。

In Delp I can include a folder's source code by adding it to the project Search Path, or adding it to the Library Path. The Search Path applies only to the current project, while the Library Path applies to any project opened with the IDE.

除此之外,搜索之间是否存在功能上的区别和库路径?

Other than that, is there any functional difference between the Search and Library paths?

我的询问原因:我有项目A使用的源文件夹X当我在Project A的搜索路径下包含该文件夹时,它说找不到该文件夹​​中的特定文件。当我将它包含在图书馆路径下时,项目A编译成罚款。

My reason for asking: I have a folder X with source used by project A. When I include that folder under Project A's search path, it says it cannot find a specific file in that folder. When I include it under the Library path, then project A compiles fine.

到目前为止,我总是觉得唯一的区别是一个是项目特定的而另一个则是全球性的。

Until now, I was always under the impression that the only difference was that one was project-specific, and the other was global.

虽然我们在讨论这个话题(并且有自己的傻瓜的风险):库之间的功能差异是什么路径和浏览路径?

While we're on the topic (and at the risk of making a fool of myself): What is the functional difference between "library path" and "browsing path"?

推荐答案

据我所知,浏览路径是调试器应该查找文件的位置打破/进入不在库路径中的源文件。

As far as I know, browsing path is where the debugger should look for files when breaking/stepping into source files thats not in the library path.

让我们说你有一个第三方使用的组件。您将库路径指向该组件的预编译dcu文件的目录。您的项目将在编译时使用这些dcu文件。这是很好的,因为它不会重新编译每次你构建。

Lets say that you have a thirdparty component that you use. You point the library path to the directory where the pre-compiled dcu-files of that component are. Your project will use these dcu-files when you compile. This is good, because it wont be recompiled every time you do a build.

但是通过包含编译的dcu文件,你放弃了调试thirparty组件的可能性。如果您在浏览路径中包含源文件所在的路径,则调试器将找到源代码,并允许您进入。

But by including the compiled dcu files, you loose the possibility to debug the thirparty component. If you include the path to where the source files are in the browse path, the debugger will find the source, and allow you to step in to it.

默认设置为vcl显示这个。在图书馆路径中,他们已经将$(BSD)\Lib放在浏览路径中,它们已经放入$(BDS)\SOURCE\WIN32 ...

The default settings for the vcl show this. In library path they have put $(BSD)\Lib, and in the browsing path they have put $(BDS)\SOURCE\WIN32...

更新:有两种不同的搜索路径:编译器搜索路径和调试器搜索路径。第一个是编译器在编译期间查找文件,第二个是调试器在调试期间查找源文件的地方。

Update: There are two different kind of search paths: Compiler search path and debugger search path. The first is there the compiler looks for files during compiling, and the second is where the debugger looks for source files during debugging.

编译器将只在库中查找文件路径或项目搜索路径。
调试器将在编译器搜索路径加浏览路径,项目的调试源路径和全局调试搜索路径中找到标识符。

The compiler will only find files in the Library path or the projects search path. The debugger will find identifiers in the compilers search path plus the browsing path, the debug source path for the project, and the global debug search path.

在全局或pr项目中指定事项不应有任何差异。

There should not be any difference in specifying things globally or pr project.

这篇关于Delphi搜索路径与库路径vs浏览路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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