How to make Visual Studio use the native amd64 toolchain

前端 未结 5 1691
無奈伤痛
無奈伤痛 2020-11-29 00:06

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

I am building a large library that causes the l

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-29 00:28

    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
    

    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
    

    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:

    difference between VS12 and VS13

    how to embed PreferredToolArchitecture into the project in VS13

提交回复
热议问题