简体   繁体   中英

How to fix Failed to compile virtual memory to PCH?

This pic really tortured me these past few days.

i created a pretty small lib myself. only 400 kb and use as library function.

Create new project and reference to it as well as using the header file. but after compiling I get this error:

在此处输入图片说明

How to fix this? this not work for me:

在此处输入图片说明

According to the Doc; Compiler Error C3859

Starting in Visual Studio 2015, the /Zm recommendation is only significant when using the #pragma hdrstop directive. In other cases, it's a spurious error that indicates Windows virtual memory pressure issues.

If your precompiled header uses a #pragma hdrstop directive, use the /Zm compiler flag to specify a larger value for the precompiled header file. Otherwise, consider reducing the number of parallel compilation processes in your build.

Could you please tell us which version of visual studio are you using? One of the best things you can do if you're experiencing errors with PCH files is to move to a newer Visual C++ compiler. We have fixed many PCH memory pressure bugs in VS 2015 and VS 2017.

For more details, I suggest you could refer to the link: https://devblogs.microsoft.com/cppblog/precompiled-header-pch-issues-and-recommendations/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM