Simulink C1061 Compiler Error
Show older comments
Hi all,
I'm running MATLAB 2012a with VisualStudio 2005 as the C++ compiler. I have recently run into an issue when generating C++ code from a Simulink model. Apparently, this is a known issue with VS2005:
The make error points to generated code in the slprj, which clearly does not have 255 (or whatever the limit) of nested loops. It has only 2 or 3 nested loops. However, because of this, the code does not get past this step to generating code in the ert_rtw folder that I need to deploy on a real time system. Short of upgrading to MATLAB 2014a and testing Visual Studio 2013, I can't think of a solution. Has anyone encountered this issue and resolved it?
c2_filename.cpp(7176) : fatal error C1061: compiler limit : blocks nested too deeply NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\cl.exe"' : return code '0x2'
When I check line 7176, it looks fine.
EDIT: I uncovered that the issue is not related to the code I added, but rather, to signals that I have added to a bus initialization file. I'm not sure why adding one more signal to the bus causes issues. It seems like in the c2_filename.cpp, there are a lot of UNNESTED loops, which is causing the Visual C++ compiler to throw the C1061 error; this is a KNOWN bug. However, it looks like 2012a 32-bit only supports C++ compilers with these bugs...
Answers (0)
Categories
Find more on MATLAB Compiler in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!