Visual Studio:不同的DLL用于配置 [英] Visual Studio: Different DLLs for configurations
问题描述
我想制作一个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,例如使用SQLite.dll for x86发行版和SQLite64.dll进行x64发行?
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?
- 不幸的是,我不能使用任何平台选项是默认的,因为那些不是x64兼容的DLL。
- 我想支持真正的x64,而不是在x64操作系统上运行32位应用程序。
推荐答案
您可以在项目文件中的dll引用中添加条件,但不能使用Visual Studio进行操作 - 您必须手动编辑项目文件。请参阅这个如何做。
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屋!