即使安装了Visual c++ 2008 Express和Windows SDK,也无法编译x64

Cant compile for x64 even after installing Visual C++ 2008 Express and Windows SDK

本文关键字:SDK x64 编译 Windows 安装 Visual c++ Express 2008      更新时间:2023-10-16

我已经安装了Visual C++ 2008 Express Edition。从这里我已经安装了MICROSOFT WINDOWS SOFTWARE DEVELOPMENT KIT FOR WINDOWS 7 and .NET FRAMEWORK 4为x64位编译。

现在我可以在配置菜单中通过IDE看到x64的选项。但每当我尝试构建这个Debug|x64选择,我得到的是:

========== Build: 0 succeeded or up-to-date, 0 failed, 1 skipped ==========

它永远不会被构建并且总是失败。C:Program Files (x86)Microsoft Visual Studio 9.0VCbin

里面也没有amd64vcvarsamd64.bat文件夹

即使试图从cmdmsbuild "[PROJECT_PATH].sln" /t:Clean,Build /p:Configuration=Debug;Platform=x64构建,我得到这个:

Microsoft (R) Build Engine Version 3.5.30729.5420
[Microsoft .NET Framework, Version 2.0.50727.5420]
Copyright (C) Microsoft Corporation 2007. All rights reserved.
Build started 11/4/2016 11:55:00 AM.
Project "[PROJECT_PATH].sln" on node 0 (Clean;Build target(s)).
  Building solution configuration "Debug|x64".
vcbuild.exe : error VCBLD0004: Project '[PROJECT_PATH].vcproj' does not contain a configuration called 'Debug|x64'.
vcbuild.exe : error VCBLD0004: Project '[PROJECT_PATH].vcproj' does not contain a configuration called 'Debug|x64'.
vcbuild.exe : error VCBLD0004: Project '[PROJECT_PATH].vcproj' does not contain a configuration called 'Debug|x64'.
Done Building Project "[PROJECT_PATH].sln" (Clean;Build target(s)) -- FAILED.

Build FAILED.

似乎工具没有安装,但我在选择编译工具后安装了Windows SDK,那么为什么不是呢?知道哪里出了问题吗?

Windows SDK不包含任何c++编译器,vc++ 2008 Express版本只有32位。您需要安装64位编译器(最新版本的vc++ Express有64位版本)。