Visual Studio C++ compiler flag: what is -Zm200?
10,599
Solution 1
-Zm is Specify Precompiled Header Memory Limit (more info here). It limits the amount of memory the compiler can allocate for processing precompiled headers. For Visual C++ 2008, -Zm200 means limit to 150 MB.
Solution 2
This limits the maximum heap size for the compiler according to this article. So this doesn't affect your program at all
Author by
sivabudh
First, I'm a dreamer who engineers and innovates. Second, I CEO at CODIUM and 1000C startups.
Updated on June 04, 2022Comments
-
sivabudh almost 2 years
I use Qt for C++ development, and today I produced a .vcproj file from a .pro file.
I noticed under the vcproj project properties, Qt added this flag into the C/C++ -> Command Line -> Additional Options
-Zm200
What is -Zm200?
-
sivabudh over 14 yearsthis is quite strange. if you look at the article pointed out by Eric, that article says 210MB!
-
Michael over 14 yearsEric's article refers to VC++ 6.0. My link points to VC++ 2008. 2005 has a different number, 2010 will probably be different still.
-
Eric over 14 yearsHey its msdn no one expect them to be either accurate or useful ^^
-
Will Bickford over 12 yearsAccording to the documentation for VC6 (msdn.microsoft.com/en-us/library/aa278580%28VS.60%29.aspx) the number is a scaling factor. It also mentions that the default limit is about 105MB. So 200 means 200% (hence 2x105 = 210). The default in VS2008 must be 75 MB if Michael is correct above.