How to resolve the module machine type 'X86' conflicts with target machine type 'x64' Visual Studio

前端 未结 5 515
傲寒
傲寒 2021-02-02 10:36

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

5条回答
  •  情话喂你
    2021-02-02 11:38

    I ran into the same issue - just with VS2013.

    There are 2 approaches which I came across which may or may not be helpful in your case:

    THE FIRST APPROACH

    (May only be relevant for versions VS2013 and above)

    Open the 'VS2015 x64 Native Tools Command Prompt' and execute the command there.

     Note:
     If you get the opposite message:
     module machine type 'x64' conflicts with target machine type 'x86' 
     then you should open the 'VS2015 x86 Native Tools Command Prompt' 
    

    Both tools can be found under the folder:

    C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\Shortcuts

    THE SECOND APPROACH

    (May only be relevant for versions prior to VS2013)

    In the Developer Command Prompt for VS2015 you can change the compiler target platform by running the following command

    "C:\Program Files (x86)\Microsoft Visual Studio 15.0\VC\vcvarsall.bat x64"

    "C:\Program Files (x86)\Microsoft Visual Studio [VS Version]\VC\vcvarsall.bat [Target Platform]"

    For VS 2017

    "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat [Target Platform]"

    Note:
    VS Version: 10.0|11.0|12.0|15.0|... 
    Target Platform: x86|amd64|x64|arm|x86_arm|x86_amd64|amd64_x86|amd64_arm|amd64_x86
    *leaving the target platform empty will default to x86
    

提交回复
热议问题