My OS is Windows 7, 64 bits.
In Visual Studio, I'm trying to build this C++ CLR project as 32 bits, but after I build it, when I run Dependency Walker on it, every system dll it uses (for example, kernel32
) is of 64 bit, thus giving the error "Modules with different CPU types were found".
I've already set the platform option to Win32 (btw, is this right? I expected x86, is Win32 equivalent?).
I also checked that in Linker->Advanced->Target Machine
is equal to MachineX86
.
Is there anything else I could do to build it targeting 32 bits.
EDIT 1:
Since HansPassant questioned the reliability of Dependency Walker, I checked the bitness using corflags
.
Results are these:
Version : v4.0.30319
CLR Header: 2.5
PE : PE32
CorFlags : 0x10
ILONLY : 0
32BITREQ : 0
32BITPREF : 0
Signed : 0
According to this this answer, apparently the dll is targeting "Any CPU".
I targeted 32 bits already, why is this happening?