LNK1112 module machine type 'X86' conflict

2019-05-23 07:06发布

问题:

I'm using cmake-2.8.9-win32-x86. I wanted to build Qt qt-win-opensource-4.8.2-vs2010 on visual studio 2010. My computer has 64 bit system. I think since either cmake or qt is x86 I'm taking this error while building. LNK1112 module machine type 'X86' conflicts with target machine type 'x64'.

How to fix this?

回答1:

The error is telling you that the linker has been run with a target that specifies x64 while the module the linker is reading was created for x86. What's wrong depends on what you are trying to do.

If you are trying to create an x64 code file then the linker target is correct and the module is wrong. If you are trying to create an x86 code file then the linker target is wrong and the module is correct.

Whichever item is wrong is the one you have to correct - either by changing the linker target or by changing the module. If the module is wrong you probably ended up compiling it with the x86 version of the compiler rather than the x64 version.