如何使用x64运行cl? [英] How can I run cl using x64?

查看:1682
本文介绍了如何使用x64运行cl?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了与这里相同的问题致命错误C1034: windows.h:没有包含路径集

I had the same problem as here fatal error C1034: windows.h: no include path set

我输入了 vcvars32.bat 但我想链接一些64位的.lib文件,当我这样做:

I typed vcvars32.bat and that solved my problem but I want to link some 64-bit .lib files and when I do:

cl main.cpp xxxlib.lib

我得到:

warning LNK4272: library machine type 'x64' conflict with target machine type 'x86'

是因为我使用 vcvars32.bat 是32位吗?在哪里可以找到64位版本?

Is it because I use the vcvars32.bat is 32 bits? Where can I find the 64 bit version?

感谢

推荐答案

为了确保您设置了正确的环境变量,最简单的方法是在开始菜单中启动相应的命令shell。

In order to make sure you have the proper environment variables set, the simplest way is to launch the respective command shell in the start menu.

对于64位, code> Visual Studio x64 Win64命令提示符(2010),那么cl.exe会自动更正。如果您在开始菜单中显示此条目的属性,还会找到更多信息:

For 64bit, this would be Visual Studio x64 Win64 Command Prompt (2010), then cl.exe is automatically correct. If you show the properties of this entry in the start menu, you'll also find more infos:


  • 开始于:C: \\ Program Files(x86)\Microsoft Visual Studio 10.0 \VC\

  • 目标:%comspec%/ kC:\Program Files (x86)\Microsoft Visual Studio 10.0 \VC\vcvarsall.batamd64

  • Start in: "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\"
  • Target : %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"" amd64

从中可以看到工作目录已设置,并且使用 amd64 参数调用 vcvarsall.bat 。这可能是你错过的。

From this, you see that the working directory is set, and vcvarsall.bat is called with the amd64 parameter. This is probably what you missed.

这篇关于如何使用x64运行cl?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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