MATLAB: Compiling simstruc.h in Visual Studio

heapsimstruc.hsimulinkvisual studio

I have compiled a Simulink model to a 64-bit dll using the ert_shrlib target in Matlab 2011b, and written a simple C++ script that imports that dll and steps through the model. I've tested the code with a simple model (that doesn't require simstruc.h) and it works. With the full model (that requires simstruc.h) the compiler runs out of heap space, eventhough I use a 64-bit compiler and have increased the heap using the Visual Studio setting /HEAP.
How can I solve this issue?

Best Answer

Found the problem. The compiler couldn't handle some of the code in the simstruc.h. Once I commented those lines out, the compilation succeeded.