When compiling some complicated templates, I sometimes get:
fatal error C1076: compiler limit : internal heap limit reached; use /Zm to specify a higher limit
I know that I can go to project settings and specify e.g. /Zm500
to give the compiler more memory (more info on /Zm
can be found here). It is however quite cumbersome and I would prefer setting a default limit globally. Is there any way to do it?
Alternately, is there any way to specify this particular flag using a pragma or other annotation of the source file? That way it would also be portable accross machines with potentially different settings.
I'm using Visual Studio 2008, if it also worked in Visual C++ 6.0, I wouldn't mind.
I finally found an answer to this, here. All that is needed, is to set the CL
environment variable:
CL=/Zm500
For example in Control Panel - System - Environment Variables (note that restart of the IDE is required). And all the builds will then use this setting, unless overridden by cl.exe
commandline arguments.
This works for both MSVC 6.0 and Visual Studio 2008.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With