Use the 64-bit Visual C ++ Toolbox in Visual Studio 2017

My (rather large) C ++ project has grown to such an extent that I get error C1060: compiler is out of heap space when trying to compile my project.

I am compiling on a Windows 10 64-bit machine, but it seems that Visual Studio is compiling my project using a 32-bit toolbox (see screenshot below).

32-bit compiler driver

the C1060 manual page asks me to use a 64-bit toolkit, but the link given tells how to enable it when compiling using only the command line.

Is there a way to set project properties or something else in Visual Studio 2017 to tell it to use the 64-bit compiler toolbox (which is already installed on my machine)?

+3
source share
1 answer

Here's how I did Visual Studio 2017 using the x64 toolkit, as per this answer:

Open your .vcxproj file with your favorite text editor, find this line:

 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> 

Then add this right after it:

 <PropertyGroup> <PreferredToolArchitecture>x64</PreferredToolArchitecture> </PropertyGroup> 

This answer was for Visual Studio 2013, but it works in 2017 as well.

Additional note: However, it turned out that this did not actually solve my problem. The 64-bit toolbox consumed all the memory on my machine and made me reboot. When I roll back the latest code changes, it compiles using ~ 2.8 GB for the 32-bit compiler and compiles using ~ 4.2 GB for the 64-bit compiler (the last code consumes ~ 6.4 GB before freezing my task manager on my 8GB machine) . I will review the new code and try to understand why more memory is required.

+3
source

Source: https://habr.com/ru/post/986145/


All Articles