如何正确设置 VS2008 进行 x64 编程? [英] How to properly setup VS2008 for x64 programing?

查看:27
本文介绍了如何正确设置 VS2008 进行 x64 编程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 x64 win7 上,我安装了 VS2008 和 x64 编译工具.我正在用一个简单的hello world"控制台程序测试它.x86 和 x64 版本都编译得无懈可击.x86 版本的 Debug 和 Release subversions 都可以正常工作.发行版 x64 版本也可以正常工作.但是,Debug x64 版本总是会引发并行错误.似乎找不到调试运行时.

On x64 win7, I installed VS2008 and x64 compile tools. I was testing it with a simple "hello world" console program. Both x86 and x64 versions were compiled flawless. Both Debug and Release subversions of the x86 version works fine. The release x64 version works fine too. However, the Debug x64 version always raises the side-by-side error. It seems like the debug runtime cannot be found.

有人建议安装Debug runtime redist.这让我很惊讶:x64 调试运行时是否应该已经作为 x86 版本随 VS2008 安装一起提供了?

Someone suggest to install the Debug runtime redist. That surprises me: does the x64 debug runtime should already come with the VS2008 installation as the x86 version?

非常感谢!

@sj1900 某些 x64 编译器组件在 VS 安装中是可选的.值得检查它们是否都已安装."这是屏幕截图:

@sj1900 "Some of the x64 compiler components are optional on a VS installation. It's worth checking that they have all been installed." here is the screenshots:

我在这里没有看到任何其他选项.winSxS 中根本没有 amd64_microsoft.vc90.debugcrt.奇怪的问题.

I did not see any further options here. There is no amd64_microsoft.vc90.debugcrt in the winSxS at all. Strange problem.

推荐答案

经过几个小时的摸索和测试,我最终认为这是一个 VS2008 安装程序错误,经多个在线参考资料证实.

After hours of head scratching and testing, I finally reckon that is a VS2008 installer bug, confirmed by several online references.

如果安装vs2008没有第一次的x64编译器工具但稍后通过修改功能安装了x64工具安装程序,错误将出现:所有 x64 调试运行时和 nodebug openMP 运行时都将丢失.重新安装不会解决这个问题.

If one installed the vs2008 without the x64 compiler tool at the first time but installed the x64 tools later via the modification feature of the installer, the bug will show up: all the x64 debug runtimes and the nodebug openMP runtime will be missing. Reinstall will not fix this problem.

我尝试了许多互联网上建议的方法:安装所有修补程序、ATL 更新、更新到 SP1 或安装 VCredist ......没有任何效果.

I tried lots of methods suggested all over the internet: install all the hotfixes, ATL updates, update to SP1 or install the VCredist ... Nothing works.

我发现有两种方法可以解决这个问题:

I figured out there are two ways to fix this:

  1. 完全卸载 VS2008,然后重新安装 VS2008,选择 x64 工具.

  1. uninstall the VS2008 completely then install the VS2008 again as fresh with the x64 tools selected.

对于安装了大量修补程序的某些人来说,这会很烦人.最直接的方法是构建一个安装程序来安装所有那些缺失的运行时:create porject->other projects->setup project.然后 add&Merge Module -> 选择所有缺少的运行时:Microsoft_VC90_OpenMP_x86_x64.msm , Microsoft_VC90_DebugOpenMP_x86_x64.msmMicrosoft_VC90_DebugCRT_x86_x64代码>.构建并发布解决方案,运行安装程序,然后转到 %windir%winsxs,您应该很高兴看到所有这些运行时文件夹.然后你就可以开始调试你的 x64 程序了.如果您使用的是 VS2008SP1,那么您可能会收到有关运行时版本的另一个错误.为避免这种情况,请在开始创建安装程序之前安装 SP1 的 ATL 更新.

this will be annoying for some person who installed lots of hotfixes. The most straightforward way is to build a installer to install all those missing runtimes: create porject->other projects->setup project. Then add&Merge Module -> select all the missing runtimes: Microsoft_VC90_OpenMP_x86_x64.msm , Microsoft_VC90_DebugOpenMP_x86_x64.msm and Microsoft_VC90_DebugCRT_x86_x64.msm. Build and release the solution, run the installer, then go to %windir%winsxs, you should happily see all those runtime folders. Then you can start to debug your x64 programs. If u are using VS2008SP1, then u probably get another error about the runtime version. To avoid this, install the ATL update for SP1 before u start to create the installer.

PS:在 VS2008 中还有许多其他烦人但不是致命的错误,M$ 从不费心去修复.因此远离 VS2008 并尝试 VS2010,除非您的项目有特殊需要迫使您坚持使用 VC9.

PS: there are lots of other annoying but not fatal bugs in VS2008 which the M$ never bother to fix. Thus stay away from VS2008 and try VS2010, unless your projects have the special need that forces you to stick to VC9.

这篇关于如何正确设置 VS2008 进行 x64 编程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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