如何在 Visual Studio 2008 中使用 Visual Studio 2010 C++ 工具? [英] How to use Visual Studio 2010 C++ tools in Visual Studio 2008?

查看:43
本文介绍了如何在 Visual Studio 2008 中使用 Visual Studio 2010 C++ 工具?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果可能的话,有谁知道如何在 Visual Studio 2008 中使用 Visual Studio 2010(编译器/链接器/sdk)附带的完整 C++ 工具集?
更改所有目录在选项-> 项目和解决方案-> VC++ 目录下监听就足够了,还是还有更多?假设我以这种方式尝试,有什么注意事项吗?

If possible at all, does anyone know how to use the full c++ toolset shipped with Visual Studio 2010 (compiler/linker/sdk) in Visual Studio 2008?
Would changing all directories listen under Options->Projects and Solutions->VC++ Directories be sufficient, or is there more to it? And suppose I try it this way, are there any caveats to it?

推荐答案

我有点忘记这个问题,直到今天一个朋友说 C++0x 有多棒.我仍然喜欢 VS2008,比 2010 更喜欢 2010,它首先是缓慢的,所以决定试一试.而且,我仍然无法相信它,但只需最少的黑客攻击,它实际上就可以工作.

I kinda forgot about this question until today a friend was saying how great C++0x was. I'm still in love with VS2008, much more than with 2010 which is above all things slow, so decided to give it a go. And, I still can't believe it, but with a minimum of hacks it actually works.

而且效果很好:在 VS2008 之前,您甚至不会注意到它实际上使用的是 2010 工具集.除非您查看 cl/link 的徽标.或者当然,除非您突然能够使用 lambda.到目前为止,我找不到任何问题.像往常一样编辑等工作,构建工作,调试工作,这就是我所需要的.

And it works great: sitting before VS2008 you don't even notice it's actually using the 2010 toolset. Unless you look at cl/link's logo. Or off course, unless you are suddenly able to use lambdas. I could not find any problems so far whatsoever. Editing etc works like it alwasy did, building works, debugging works, that's all I need.

这是我所做的:

  • 制作一个批处理文件来设置环境以与 Windows SDK 7.1/VS2010 工具集一起使用,但将 devenv 从 VS2008 安装中保留.大部分是从 2010 年的 setenv.cmd 复制的.
  • 现在是脏点:将 msobj100.dll、mspdb100.dll、mspdbcore.dll 和 mspdbsrv.exe 复制到 2010 的 VSINSTALLDIR/bin 目录中(或将它们放在您的 PATH somweher 中).这是必需的,否则 cl.exe 不起作用,也不会调试.
  • 从使用 devenv/useenv
  • 运行批处理文件的同一命令行启动
  • 微笑

这是用于 x64 机器的批处理文件:

This is the used batchfile for an x64 machine:

SET PlatformToolset=Windows7.1SDK
SET ToolsVersion=4.0
SET WindowsSDKVersionOverride=v7.1
SET Path32=%ProgramFiles(x86)%
SET "VCINSTALLDIR=%Path32%\Microsoft Visual Studio 10.0\VC\"
SET "VSINSTALLDIR=%Path32%\Microsoft Visual Studio 10.0\"
SET "VCTools=%VCINSTALLDIR%Bin"
SET "VCTools=%VCTools%;%VCTools%\VCPackages;"
SET "VCLibraries=%VCINSTALLDIR%Lib"
SET "VCIncludes=%VCINSTALLDIR%INCLUDE"
SET Path=%FxTools%;%VSTools%;%VCTools%;%SdkTools%;%Path%
SET OSLibraries=%WindowsSdkDir%Lib
SET OSIncludes=%WindowsSdkDir%INCLUDE;%WindowsSdkDir%INCLUDE\gl
SET "LIB=%VCLibraries%;%OSLibraries%;%FxTools%"
SET "LIBPATH=%FxTools%;%VCLibraries%"
SET "INCLUDE=%VCIncludes%;%OSIncludes%"

EDIT 而不是将批处理文件与/useenv 结合,还有另一种方法可以做同样但更直接的事情:VC++ 目录的设置都保存在文件 %APPDATA%/VisualStudio/9.0/VCComponents 中.dat.因此,如果您使用原始文件并将所有出现的 $(VCINSTALLDIR) 替换为 $(ProgramFiles)\Microsoft Visual Studio 10.0\VC\,它也能正常工作.

EDIT instead of batchfile combined with /useenv, there's another way that does the same but more direct: the settings for VC++ Directories are all saved in the file %APPDATA%/VisualStudio/9.0/VCComponents.dat. So if you take the original one and replace all occurrences of $(VCINSTALLDIR) with $(ProgramFiles)\Microsoft Visual Studio 10.0\VC\ it works as well.

这篇关于如何在 Visual Studio 2008 中使用 Visual Studio 2010 C++ 工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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