如何使Visual Studio中使用本地AMD64工具链 [英] How to make Visual Studio use the native amd64 toolchain

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

问题描述

我怎样才能获得的Visual Studio 2012使用本地AMD64工具链,而不是默认的x86_amd64交叉编译器?

How can I get Visual Studio 2012 to use the native amd64 toolchain, rather than the default x86_amd64 cross-compiler?

我建立一个大型图书馆,导致链接器做的整个程序优化和链接时code代时耗尽内存。

I am building a large library that causes the linker to run out of memory when doing whole program optimization and link-time code generation.

我找到了两个旧帖子(<一href="http://stackoverflow.com/questions/10731090/how-to-enable-native-64-bit-compiler-in-visual-studio">here和<一href="http://stackoverflow.com/questions/14188380/how-to-make-visual-studio-2012-call-the-the-native-64-bit-visual-c-compiler-in">here)问同样的问题,但没有解答。微软提供了有关如何指定工具链的上的命令行的,但不是在IDE

I found two older posts (here and here) asking this same question, but no answers yet. Microsoft provides documentation on how to specify the toolchain on the command line, but not in the IDE.

推荐答案

您需要设置环境变量_IsNativeEnvironment为真之前,要启动的Visual Studio 2012 IDE:

You need to set the environment variable "_IsNativeEnvironment" to "true" prior to starting Visual Studio 2012 IDE:

set _IsNativeEnvironment=true
start "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe" your_solution.sln

对于Visual Studio 2013,环境变量的名称是不同的:

For Visual Studio 2013, the name of the environment variable is different:

set PreferredToolArchitecture=x64
sbm start "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe" your_solution.sln

要注意的是这种技术不工作,如果在IDE的版本不匹配的工具链的版本。也就是说,如果你使用VS2013 IDE配置为运行VS2012的编译器,你的运气了。但是,这样的组合是罕见的。

Beware that this technique does not work if the version of the IDE does not match the version of the toolchain. That is, if you use VS2013 IDE configured to run VS2012 compiler, you are out of luck. But such combination is uncommon.

下面有一些链接了解更多信息:

Here are some links for further information:

<一个href="https://connect.microsoft.com/VisualStudio/feedback/details/800059/isnativeenvironment-true-no-longer-works-on-visual-studio-2013-rc">difference VS12和VS13 之间

<一个href="http://blogs.msdn.com/b/vcblog/archive/2013/10/30/the-visual-c-linker-best-practices-developer-iteration.aspx">how嵌入preferredToolArchitecture成VS13 项目

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

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