Visual Studio:用于配置的不同 DLL [英] Visual Studio: Different DLLs for configurations

查看:25
本文介绍了Visual Studio:用于配置的不同 DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为我的应用程序制作 x86 和 x64 版本,因为我使用的一些库在 x86 和 x64 上有所不同(例如 SQLite).我为目标操作系统x64"的发布版本做了一个新的配置.

I'd like to make a x86 and x64 version of my application because some of the libraries I'm using have differences for x86 and x64 (e.g. SQLite). I made a new configuration for release builds that has as target operating system "x64".

有没有办法为配置定义不同的 DLL,例如x86 版本使用 SQLite.dll,x64 版本使用 SQLite64.dll?

Is there a way to define different DLLs for the configuration e.g. use SQLite.dll for x86 release and SQLite64.dll for x64 release?

  1. 不幸的是,我无法使用默认的任何平台"选项,因为那些不兼容 x64 的 DLL.
  2. 我想支持真正的 x64,而不是在 x64 操作系统上运行 32 位应用程序.

推荐答案

您可以向项目文件中的 dll 引用添加条件,但不能使用 Visual Studio 执行此操作 - 您必须手动编辑项目文件.见 this 了解如何操作.

You can add conditions to the dll references in the project file but you cannot do it using Visual Studio - you will have to hand-edit the project files. See this for how to do it.

您需要做的是仅在 32 位构建配置中包含对 32 位 dll 的引用,并在 64 位构建配置中包含对 64 位 dll 的引用.

What you need to do is to include a reference to the 32-bit dll only in the 32-bit build configuration, and a reference to the 64-bit dll in the 64-bit build configuration.

这篇关于Visual Studio:用于配置的不同 DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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