开发者

Adding components to a component folder

开发者 https://www.devze.com 2023-03-28 10:49 出处:网络
I\'m working on a Delphi project and I want to add a parser to it. The parser comes with components that should be added to the project

I'm working on a Delphi project and I want to add a parser to it. The parser comes with components that should be added to the project

So it works great if I add the files to the same folder that my project is in, but I would like it to be in a separate components folder (to keep it cleaner, since I'm not going to be modifying those files anyway).

However, when I add create a components folder and add the files there, when I add it to the project through delphi, it has trouble finding the files. So it adds the .psu files to the right folder, but it says it can开发者_高级运维't find the unit 'Calculator', for example, until I copy the Calculator.dcu file from the component directory to the source directory.

How do I tell Delphi to look for those files where I put them?

Thanks


You have some options:

  • Add the units folder to the Projects' Search Path (Menu: Project\Options...) - only affects the project you're working now.
  • Add the units folder to the Environment's Library Path (Menu: Tools\Options...\Environment Options\Delphi Options\Library - Win32) if you want all projects in this ide install to find that units (not only the project you are working).
  • Just to complement: if, in the near future, you add components to your pallete and the compilation fail not finding the units; you'll have to update your system path as well. For details give a search on SO on this, as this is a common source of questions on the delphi tag... ;-)


Take a look at the Search Path for the project in the project options. Make sure your .pas and/or .dcu files are in that search path, i.e. add the folder in which the units are to your project's search path.

0

精彩评论

暂无评论...
验证码 换一张
取 消