问题描述
当使用visual studio构建64位VC ++解决方案时,它会成功构建并且所有二进制文件都是64位的。
令人惊讶的是,当试图构建相同的visual studio解决方案(64位)时带有以下命令的命令行,结果二进制文件是32位。
命令1:C:\Program Files(x86)\ Microsoft Visual Studio 14.0 \ VC> vcvarsall amd64
命令2:C:\Program Files(x86)\ Microsoft Visual Studio 14.0\VC>" C:\Program Files(x86)\ Microsoft Visual Studio 14.0 \ Common7 \IDE \ devenv.com" D:/MySolution.sln / rebuild release
我错过了什么(或环境问题)?
它有什么解决方案?我只需要用命令行构建解决方案。
When 64-bit VC++ solution is built with visual studio, it builds successfully and all binaries are 64-bit.
Surprisingly, When tried to build same visual studio solution (64-bit) on command line with below commands, resulting binaries are 32-bit.
command 1: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC>vcvarsall amd64
command 2: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC>"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.com" D:/MySolution.sln /rebuild release
Am I missing anything (Or environment issue)?
What is the solution for it? I need to build solution with command line only.
推荐答案
欢迎光临MSDN论坛。
Welcome to MSDN forum.
如果要生成所有二进制文件是64位,则应在Configuration Manager窗口中选择平台x64:
If you want generate all binaries are 64-bit, you should select platform x64 on the Configuration Manager window:
保存,然后使用命令行构建项目。
Save it, then build the project with your command line.
当然,您也可以使用命令行指定平台:
Certainly, you can also specify the platform with your command line:
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.com" D:/MySolution.sln /rebuild "Release|x64"
希望这会有所帮助。
Hope this helps.
这篇关于使用visual studio构建的64位VC ++解决方案不能使用命令行构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!