开发者

How to generate a 32bit only Managed C++ Assembly

开发者 https://www.devze.com 2023-02-10 12:40 出处:网络
I need to compile a DLL in Managed C++ in Visual Studio 2005. I want it with 32Bit corflag on. See http://illuminatedcomputing.com/blog/?p=117 for reference.

I need to compile a DLL in Managed C++ in Visual Studio 2005.

I want it with 32Bit corflag on. See http://illuminatedcomputing.com/blog/?p=117 for reference.

By default, I choose Win32 platform and set the /MACHINE:X86 option in the liker, but the DLL generated has the 32bit corflag off. You can see it by executing from command line

corflags MyDll.dll

I have problems when running that dll in a Windows 64 bit. So I need to force the dll to 32 bit.

Any idea on how to c开发者_如何学Configure the Visual Studio 2005 compiler?


You can actually use CorFlags.exe to set this. In the command line:

corflags MyDll.dll /32BIT+

This will set the 32 bit flag for MyDll.dll.

For more information see the corflags tag wiki.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号