简体   繁体   English

如何将库路径添加到 delphi 项目?

[英]How can I add a library path to a delphi project?

I have a couple precompiled (3rd party) libraries that I need to use in my project.我有几个预编译(第 3 方)库需要在我的项目中使用。

I can get it to build if I put foo.a in the root of my project folder, however, I have a 32 bit version and a 64 bit version of the library and I don't want to have to swap out foo.a with foo.32.a and foo.64.a every time I build each version of the application.如果我将 foo.a 放在项目文件夹的根目录中,我可以构建它,但是,我有一个 32 位版本和一个 64 位版本的库,我不想换掉foo.a每次我构建应用程序的每个版本时都使用foo.32.afoo.64.a

In this particular case I've put them in:在这种特殊情况下,我将它们放入:

[myroot]\iOSDevice32\Debug\foo.a
[myroot]\iOSDevice32\Release\foo.a

and

[myroot]\iOSDevice64\Debug\foo.a
[myroot]\iOSDevice64\Release\foo.a

I could put it in the libary path (Tools -> Options -> Delphi Options -> Library -> Library Path);我可以把它放在库路径中(工具 -> 选项 -> Delphi 选项 -> 库 -> 库路径); however, I want it to be specific to the project and relative to the root of the project folder (rather than hard coded to one location for all projects).但是,我希望它特定于项目并相对于项目文件夹的根目录(而不是硬编码到所有项目的一个位置)。

How can I tell Delphi/Embarcadero RAD Studio where to find these libraries?我如何告诉 Delphi/Embarcadero RAD Studio 在哪里可以找到这些库?

Put it in the project's search path (Project->Options->Delphi Compiler). 将其放在项目的搜索路径中(Project-> Options-> Delphi Compiler)。 You'll see a couple of examples there for using .\\$(Platform)\\$(Config) , which is a relative path to the project based on the target platform and build configuration. 您将在其中看到几个使用.\\$(Platform)\\$(Config)的示例,这是基于目标平台和构建配置的项目的相对路径。

转到工具-选项-语言-delphi-library

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

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