Search code examples
c++visual-studio-201032bit-64bit32-bit

fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86' running build via vcvarsall.bat x86


I am trying to build 32bit exe on 64bit OS. Steps that I followed :

  1. I ran Visual Studio Command Prompt (2010) which sets environment for x86 tools.(as admin) also tried "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat x86"
  2. I ran the makefile.nt via nmake.
  3. I am using boost Libraries which are 32 bit .
  4. Ran into error

"libboost_thread-vc100-mt-1_50.lib(thread.obj) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'"

I understand my OS is 64bit and my target machine is X86 but this problem should be taken care when I trigger C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat x86 which automatically sets environment variable for x86.

Any help would be appreciated.


Solution

  • Thank you all for input.After debugging for two days. I found that I have multiple installations of boost library included in my solution