C++ 使用 Visual Studio 为 x64 编译?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2273146/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Compile for x64 with Visual Studio?
提问by Stefan Steiger
Question: Assume a C++ hello world program, non .NET. With Visual Studio 2005/2008/2010, how can I compile a 64-Bit application ? I have a 64 Bit Windows, but by default, VS seems to compile 32 bit executables...
问题:假设一个 C++ hello world 程序,非 .NET。使用 Visual Studio 2005/2008/2010,如何编译 64 位应用程序?我有一个 64 位的 Windows,但默认情况下,VS 似乎编译 32 位可执行文件......
On Linux with g++, I can use -m32 and -m64, but how can I compile a 64 bit solution with Windows ? Is it even possible with 2005 ? Or does one need 2008 or even 2010 Beta, or even some x64 SDK ?
在带有 g++ 的 Linux 上,我可以使用 -m32 和 -m64,但是如何使用 Windows 编译 64 位解决方案?2005甚至有可能吗?或者是否需要 2008 甚至 2010 Beta,甚至一些 x64 SDK?
回答by Igor Korkhov
There is a step-by-step instructions by Microsoft: http://msdn.microsoft.com/en-us/library/9yb4317s.aspx
Microsoft 提供了分步说明:http: //msdn.microsoft.com/en-us/library/9yb4317s.aspx
回答by Rowland Shaw
It sounds like it may just be that you haven't set the correct target. It is possible to also build x64 applications on an x86 using the cross compiler tools.
听起来可能只是您没有设置正确的 target。还可以使用交叉编译器工具在 x86 上构建 x64 应用程序。

