I am compiling Openssl library that I need to use in python script. I am using Visual Studio 2015 Developer Command Prompt. My machine is Windows 7 64-bit.
When I type t
This error comes up because a specific component in the build is being compiled as an x86 binary instead of x64 (the target machine's architecture) - basically you're giving the linker a square puzzle piece and telling it to fit into a circular hole.
In your case:
tmp32dll\uplink.obj : fatal error LNK1112: module machine type 'X86' conflicts w
ith target machine type 'x64'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0
\VC\BIN\amd64_arm\link.EXE"' : return code '0x458'
Stop.
You look at the name of the obj file that is causing the error: uplink.obj, so you look at uplink.cpp (or uplink.asm or uplink.whatever) and inspect how it's being compiled. Usually all that stuff is automated in VS but sometimes there are special build steps that were added in by the developer. Inspect the custom, pre- and post- build events to see if a x86 tool is being used to assemble it.
In my case, I was trying to compile 7zip in x64 using visual studio 8 and everything was compiling except for the assembly macros (asm), which were compiling in x86 and breaking the build process. I found that VS was trying to use ml.exe to compile them instead of ml64.exe by looking at the asm's property sheet. In my case changed the call to ml64.exe to get rid of this error (I also had to modify the asm files to be 64bit only by getting rid of all the x86 code but that's another story).