本文介绍了糟糕到DLL....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我指定了一个适用于32位或64位的dll,并最终构建了Win32 dll.那么我该如何转换呢?涉及什么?

I specified a dll that was good for 32 or 64 bits and wound up building a Win32 dll. So how do I convert it? Whats involved?

我如何调试它?

蕾妮

推荐答案

您必须构建DLL的两个版本,一个用于Win32,一个用于X64. Win32构建是使用32位编译器构建的,仅生成32位代码,指针为4字节,并且堆栈与此对齐. X64构建是使用X64编译器构建的 并生成64位代码,指针为8个字节,并且堆栈与此对齐.

You must build two versions of the DLL, one for Win32 and one for X64. The Win32 build is built by using the 32 bit compiler and only produces 32 bit code, pointers are 4 bytes and the stack is aligned to this. The X64 build is built using the X64 compiler and 64 bit code is produced, pointers are 8 bytes and the stack is aligned to this.

因此,您必须设置VS才能构建64位版本.您可以通过配置管理器来创建X64平台,然后选择并构建它.输出将用于X64而不是Win32.

So you have to set VS to build a 64 bit version. You do this through configuration manager creating the X64 platform and then select this and build it. The output will be for X64 instead of Win32.


这篇关于糟糕到DLL....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 12:48