visual-studio 在 Visual Studio 2008 Express Edition (VS2008EE) 中配置 64 位编译

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3376198/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 12:17:21  来源:igfitidea点击:

Configuring 64-bit compilation inside Visual Studio 2008 Express Edition (VS2008EE)

visual-studio64-bitvisual-studio-2008-sp1

提问by bgoodr

I am making an attempt at building 64-bit native C++ applications under Visual Studio 2008 Express Edition Service Pack 1 (with some relevant Windows SDK(s) installed afterwards), in the IDE and from the command line. This is on a Windows XP Professional x64 Edition Version 2003 Service Pack 2 machine.

我正在尝试在 Visual Studio 2008 Express Edition Service Pack 1(随后安装一些相关的 Windows SDK)、IDE 和命令行下构建 64 位本机 C++ 应用程序。这是在 Windows XP Professional x64 Edition Version 2003 Service Pack 2 机器上。

I know that the Professional versions might provide true VS IDE integration, but I'm specifically looking to do this from within Visual Studio 2008 Express Edition.

我知道 Professional 版本可能会提供真正的 VS IDE 集成,但我特别希望在 Visual Studio 2008 Express Edition 中做到这一点。

But, I'm having a bit of trouble in the project configuration in the Visual Studio 2008 Express IDE, and am hoping someone can answer what might be the problem. The key goal is to be able to build 64-bit native apps from within the IDE itself, as well as from the command line by executing batch files like vcvarsall.bator similar batch file.

但是,我在 Visual Studio 2008 Express IDE 中的项目配置中遇到了一些麻烦,我希望有人能回答可能是什么问题。关键目标是能够从 IDE 本身以及通过执行批处理文件(如vcvarsall.bat或类似的批处理文件)从命令行构建 64 位本机应用程序。

Here is what I tried so far:

这是我到目前为止尝试过的:

I installed Visual Studio 2008 Express Editions with SP1, which installed some type of SDK, but I believe not the right one containing 64-bit compilers (but didn't know it at the time).

我安装了带有 SP1 的 Visual Studio 2008 Express Editions,它安装了某种类型的 SDK,但我认为不是包含 64 位编译器的正确版本(但当时不知道)。

I built a hello world Win32 Console app, and looked in the manifest file that was generated for the executable. I found "x86" in that manifest file, which is not 64-bit AFAICT, so I did more research.

我构建了一个 hello world Win32 控制台应用程序,并查看了为可执行文件生成的清单文件。我在那个清单文件中找到了“x86”,它不是 64 位 AFAICT,所以我做了更多的研究。

I found What is “missing” in the Visual Studio 2008 Express Editions?. I saw some replies, one of which was has a list of missing featureswhich has "64-bit Visual C++ Tools" as one of those missing features.

我发现Visual Studio 2008 Express Edition 中“缺少”了什么?. 我看到了一些回复,其中一个是缺少功能的列表,其中包含“64 位 Visual C++ 工具”作为缺少的功能之一。

But, on the wikipedia entrywe see:

但是,在维基百科条目上,我们看到:

True integration of 64bit compilers to the Visual C++ 2008 Express Edition is possible, but remains cumbersome. 9

将 64 位编译器真正集成到 Visual C++ 2008 Express Edition 是可能的,但仍然很麻烦。9

So, I tried the instructions in that 9link given above. That link actually refers to How to: Configure Visual C++ Projects to Target 64-Bit Platforms. I walked through the steps on that page, but got to the point where they instruct you to do the following:

所以,我尝试了上面给出的9 个链接中的说明。该链接实际上是指How to: Configure Visual C++ Projects to Target 64-Bit Platforms。我完成了该页面上的步骤,但到了他们指示您执行以下操作的地步:

Click the Type or select the new platform drop-down arrow, and then select a 64-bit platform.

单击类型或选择新平台下拉箭头,然后选择 64 位平台。

But there are no entries in the drop down.

但是下拉菜单中没有条目。

I referred again to the SDK page on Wikipedia, specifically the 64-bit development section, which states:

我再次参考维基百科上的 SDK 页面,特别是64 位开发部分,其中指出:

The most recently released Windows SDK for Windows Server 2008 and .NET Framework 3.5 contains the updated x86, x64 and Itanium (IA-64) Visual Studio 2008 compilers.

最近发布的适用于 Windows Server 2008 和 .NET Framework 3.5 的 Windows SDK 包含更新的 x86、x64 和 Itanium (IA-64) Visual Studio 2008 编译器。

So Googling/MSDN'ing around a bit for "Windows SDK for Windows Server 2008 and .NET Framework 3.5" landed me at the Which SDK do I install?page. From that page I see Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 Service Pack 1released on Aug-09 since it is the most recent one. Its release notes seemed to imply that it contained 64-bit compilers at least, but didn't explicitly state that it patched the Visual Studio IDE to provide a way to select x64 targets, and that is what I'm after.

因此,在 Google/MSDN 上搜索“适用于 Windows Server 2008 和 .NET Framework 3.5 的 Windows SDK”让我找到了我该安装哪个 SDK?页。从该页面,我看到适用于 Windows 7 的 Microsoft Windows SDK 和 .NET Framework 3.5 Service Pack 1于 09 年 8 月发布,因为它是最新版本。它的发行说明似乎暗示它至少包含 64 位编译器,但没有明确说明它修补了 Visual Studio IDE 以提供一种选择 x64 目标的方法,这就是我所追求的。

I tried the How to: Configure Visual C++ Projects to Target 64-Bit Platformsinstructions again, and got the same empty drop-down list.

我再次尝试了How to: Configure Visual C++ Projects to Target 64-Bit Platforms说明,并得到相同的空下拉列表。

So I thought then that the compilers aren't installed, so I tried executing the vcvarsall.bat amd64command, and ran into the bug described at More VS2008 and Windows SDK Server 2008 problems.

所以我当时认为没有安装编译器,所以我尝试执行vcvarsall.bat amd64命令,并遇到了更多 VS2008 和 Windows SDK Server 2008 问题中描述的错误。

Even if I hack the vcvarsall.batbatch file to get command-line builds working, will the IDE still be "crippled" by not being able to configure Visual Studio projects to build using the 64-bit compiler?

即使我破解vcvarsall.bat批处理文件以使命令行构建正常工作,IDE 是否仍会因无法配置 Visual Studio 项目以使用 64 位编译器构建而“瘫痪”?

Thanks!

谢谢!

bg

背景

采纳答案by lezurp

Short!

短的!

Windows SDK for Windows 7 and .NET Framework 3.5 SP1

适用于 Windows 7 和 .NET Framework 3.5 SP1 的 Windows SDK

AND

http://jenshuebel.wordpress.com/2009/02/12/visual-c-2008-express-edition-and-64-bit-targets/

http://jenshuebel.wordpress.com/2009/02/12/visual-c-2008-express-edition-and-64-bit-targets/