Discussion:
/clr and heap space problems
(too old to reply)
Thibaut Klein
2009-11-02 22:15:01 UTC
Permalink
I have a strange problem with /clr compilation.
Here is a description of the problem (hopefully complete enough for someone
with a more expert eye to spot what I'm doing wrong)
I have a native static library written in native c++. It is heavily
templated (it's CGAL for those who have already used it). I can compile this
library with or without /clr and the compilation works. Then I try to compile
managed code that calls that library with the following command line

/O1 /Ob2 /I "C:\CGAL\CGAL-3.5\include" /I
"C:\CGAL\CGAL-3.5\examples\Mesh_3\..\..\include" /I
"C:\CGAL\CGAL-3.5\examples\Mesh_3" /I
"C:\CGAL\CGAL-3.5\auxiliary\gmp\include" /I "C:\boost\boost_1_40_0" /D
"WIN32" /D "_WINDOWS" /D "_CRT_SECURE_NO_DEPRECATE" /D
"_SCL_SECURE_NO_DEPRECATE" /D "_CRT_SECURE_NO_WARNINGS" /D
"_SCL_SECURE_NO_WARNINGS" /D "NDEBUG" /D "CMAKE_INTDIR=\"Release\"" /D
"_UNICODE" /D "UNICODE" /FD /EHa /MD /Gy /Fo"x64\Release\\"
/Fd"x64\Release\vc90.pdb" /W3 /nologo /c /Zi /TP /errorReport:prompt /Zm1000
/fp:except-

and the /clr switch activated.

This compilation fails and I get the following error : "compiler out of heap
space"

To try and narrow the problem down I wrote a small application calling the
same library and that only does normal c++. When I compile it with the
previous command line i get the same error, whereas if i compile it with the
same command line except for the /clr switch that i set to off, it compiles
and run fine.


Did anyone ever encounter this problem before ?
Thank you for your help.
Stephan T. Lavavej [MSFT]
2009-11-03 02:34:38 UTC
Permalink
/Zm1000 asks the compiler to reserve 1000% (i.e. 10x) of the default space
for the PCH. This is GINORMOUS.

You should compile without /Zm. If the compilation fails saying you need
more PCH space, then use the suggested /Zm value or one slightly larger (as
a buffer for the future).

STL
Post by Thibaut Klein
I have a strange problem with /clr compilation.
Here is a description of the problem (hopefully complete enough for someone
with a more expert eye to spot what I'm doing wrong)
I have a native static library written in native c++. It is heavily
templated (it's CGAL for those who have already used it). I can compile this
library with or without /clr and the compilation works. Then I try to compile
managed code that calls that library with the following command line
/O1 /Ob2 /I "C:\CGAL\CGAL-3.5\include" /I
"C:\CGAL\CGAL-3.5\examples\Mesh_3\..\..\include" /I
"C:\CGAL\CGAL-3.5\examples\Mesh_3" /I
"C:\CGAL\CGAL-3.5\auxiliary\gmp\include" /I "C:\boost\boost_1_40_0" /D
"WIN32" /D "_WINDOWS" /D "_CRT_SECURE_NO_DEPRECATE" /D
"_SCL_SECURE_NO_DEPRECATE" /D "_CRT_SECURE_NO_WARNINGS" /D
"_SCL_SECURE_NO_WARNINGS" /D "NDEBUG" /D "CMAKE_INTDIR=\"Release\"" /D
"_UNICODE" /D "UNICODE" /FD /EHa /MD /Gy /Fo"x64\Release\\"
/Fd"x64\Release\vc90.pdb" /W3 /nologo /c /Zi /TP /errorReport:prompt /Zm1000
/fp:except-
and the /clr switch activated.
This compilation fails and I get the following error : "compiler out of heap
space"
To try and narrow the problem down I wrote a small application calling the
same library and that only does normal c++. When I compile it with the
previous command line i get the same error, whereas if i compile it with the
same command line except for the /clr switch that i set to off, it compiles
and run fine.
Did anyone ever encounter this problem before ?
Thank you for your help.
Continue reading on narkive:
Loading...