如何为delphi项目添加库路径? [英] How can I add a library path to a delphi project?

查看:743
本文介绍了如何为delphi项目添加库路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个需要在项目中使用的预编译(第三方)库。

I have a couple precompiled (3rd party) libraries that I need to use in my project.

如果我将foo.a放入,则可以构建它我的项目文件夹的根目录,但是,我有32位版本的库和64位版本的库,我不想换出 foo.a 每次构建应用程序的每个版本时,都使用 foo.32.a foo.64.a

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.

在这种特殊情况下,我将它们放入:

In this particular case I've put them in:

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

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

我可以放入库路径(工具->选项-> Delphi选项->库->库路径);但是,我希望它特定于项目并且相对于项目文件夹的根目录(而不是硬编码到所有项目的一个位置)。

I could put it in the libary path (Tools -> Options -> Delphi Options -> Library -> Library Path); 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).

如何我告诉Delphi / Embarcadero RAD Studio在哪里可以找到这些库?

How can I tell Delphi/Embarcadero RAD Studio where to find these libraries?

推荐答案

将其放在项目的搜索路径中(Project-> Options -> Delphi编译器)。您将看到几个使用 .\ $(Platform)\ $(Config)的示例。这是基于目标的项目的相对路径平台和构建配置。

Put it in the project's search path (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.

这篇关于如何为delphi项目添加库路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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