I am using a software called Symbols for engineering modelling. It produces a .cpp file for the model, along with a .bat file for command line compiling. It uses a compiler to produce a .dll file which it then calls back to complete the simulation.
It uses Visual C++ 6.0 Complier. I am getting and error xxx.cpp(64952) : fatal error C1076: compiler limit : internal heap limit reached; use /Zm to specify a higher limit
I tried adding /Zm500
to the bat file, but it produced no change. There were some suggestions online to use /MP
. Tried that. That also didn't work. I also tried adding a User Defined Environment Variable CL with values as #/Zm500
/Zm500
=/Zm500
etc. but none of those worked.
I am not an expert in Programming and can't do much edits to the code as it is auto generated.
Anyone can help regarding this? Why /Zm
is not working? Should I be doing something else?
I am using Visual Studio 6.0 in Win10 Machine. The .cpp file has 151,000 lines of code.
Adding below the contantes of .bat file
@ECHO OFF
ECHO --------------------Configuration: 8 Coil No MC 45L 1Rd - Win32 Release--------------------
SET OLDPATH=%PATH%
PATH="C:\WINDOWS";"C:\WINDOWS\system32";"C:\WINDOWS\COMMAND";"F:\Program Files (x86)\Microsoft Visual Studio\Common\MSDev98\Bin";"F:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin";"F:\Program Files (x86)\Microsoft Visual Studio\Common\Tools";"F:\Program Files (x86)\Microsoft Visual Studio\Common\Tools\WinNT";
ECHO Compiling...
CL.EXE /Zm500 /MP /nologo /I "D:\Symbols\SYMBOLS Sonata\Bin" /I "D:\Bondgraph_Works\Header_Files" /I "F:\Program Files (x86)\Microsoft Visual Studio\VC98\Include" /I "F:\Program Files (x86)\Microsoft Visual Studio\VC98\ATL\Include" /I "F:\Program Files (x86)\Microsoft Visual Studio\VC98\MFC\Include" /MT /W3 /GX /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /Fo"8 Coil No MC 45L 1Rd.obj" /Fp"8 Coil No MC 45L 1Rd.pch" /Fd"" /FD /c "8 Coil No MC 45L 1Rd.cpp"
ECHO Linking...
LINK.EXE /libpath:"D:\Symbols\SYMBOLS Sonata\Bin" /libpath:"D:\Symbols\Borland\BCC55\Lib" /libpath:"F:\Program Files (x86)\Microsoft Visual Studio\VC98\Lib" /libpath:"F:\Program Files (x86)\Microsoft Visual Studio\VC98\MFC\Lib" kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /incremental:no /machine:I386 /def:"8 Coil No MC 45L 1Rd.def" /out:"8 Coil No MC 45L 1Rd.dll" "8 Coil No MC 45L 1Rd.obj" "Library.Lib"
PATH=%OLDPATH%
ECHO End of Compilation.
See if you can increase the size of the /Zmnnnnn number.
/Zm10000 I don't recall the upper limit. Microsoft has a hard limit at some point on symbols it can keep track of. Visual Studio 6.0 is a CIRCA 1998 compiler. In comparasion it's like riding to work on a horse compared to driving a Tesla.
I don't beleive Visual Studio 6.0 supports the /MP switch. Its that old.
You can use the tiny_cc pre-processor thats one solution we used when we needed to pre-process large files. Tiny_cc is open source, but you would have to build it and I don't recall the switch to CL.exe to tell it to use that pre-processor. But thats the solution we used.
If you were 'C' savvy you might be able to split the file in two, and/or try using pre-compiled headers which might reduce the symbols the pre-processor sees.
But /Zm500 seems to be a small number I think you can go higher.