如何解决模块机器类型"X86"与目标机器类型"x64"冲突Visual Studio [英] How to resolve the module machine type 'X86' conflicts with target machine type 'x64' Visual Studio

查看:668
本文介绍了如何解决模块机器类型"X86"与目标机器类型"x64"冲突Visual Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编译需要在python脚本中使用的Openssl库.我正在使用Visual Studio 2015开发人员命令提示符.我的机器是Windows 7 64位.

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.

当我键入命令时:nmake -f ms\ntdll.mak

我收到此错误:

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.

我进行了搜索,针对类似问题的几种解决方案建议从项目设置更改项目平台.我没有VS项目.我正在运行所有这些命令只是为了编译OpenSSL库.我正在使用VS命令.

I searched and several solutions for similar problem suggest changing the project platform from the project settings. I do not have VS project. I am running all these commands just to compile the OpenSSL library. I am using the VS command.

推荐答案

我遇到了相同的问题-仅在VS2013中.

I ran into the same issue - just with VS2013.

我遇到过2种方法,它们可能对您的情况没有帮助:

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

第一种方法

(可能仅与VS2013及更高版本有关)

(May only be relevant for versions VS2013 and above)

打开"VS2015 x64本机工具命令提示符",然后在此处执行命令.

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

第二种方法

(可能仅与VS2013之前的版本相关)

(May only be relevant for versions prior to VS2013)

在VS2015的开发人员命令提示符中,您可以通过运行以下命令来更改编译器目标平台

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 15.0\VC\vcvarsall.bat x64"

"C:\ Program Files(x86)\ Microsoft Visual Studio [VS 版本] \ VC \ vcvarsall.bat [目标平台]"

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

对于VS 2017

"C:\ Program Files(x86)\ Microsoft Visual Studio \ 2017 \ Enterprise \ VC \ Auxiliary \ Build \ vcvarsall.bat [目标平台]"

"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

这篇关于如何解决模块机器类型"X86"与目标机器类型"x64"冲突Visual Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆