Visual Studio中:不同的DLL配置不同、Visual、Studio、DLL

2023-09-08 10:25:53 作者:独奏我的歌、

我想使我的应用程序,因为一些我使用的是有分歧的x86和x64(如SQLite的)的库的x86和x64版本。 我做了发布一个新的配置可以生成一个拥有目标操作系统的64。

有没有一种方法来定义不同的dll的配置如:使用SQLite.dll在x86版本和SQLite64.dll用于基于x64的版本?

不幸的是我不能使用任何平台选项,这是因为这些不兼容64位的DLL默认。 我要支持真正的64位,而不是运行在x64操作系统是32位应用程序。 解决方案

您可以添加条件,在项目文件中的DLL引用,但使用Visual Studio你不能做到这一点 - 你必须手工编辑项目文件。请参阅this对于如何做到这一点。

您需要做的是在其中提到到32位DLL仅在3​​2位版本的配置,并引用了64位的DLL在64位版本的配置。

visual studio 2013怎么修改界面字体和大小

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".

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?

Unfortunately I can't use the "any platform" option which is default because of those not x64 compatible DLLs. I want to support real x64 and not running a 32 bit application on an x64 OS.

解决方案

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.

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.