1
votes

I get the compiler error when I attempt to compile a Simulink model to C/C++ code with a external interface:

ert_main.cpp(118) : error C3861: 'rtSetTFinalForExtMode': identifier not found ert_main.cpp(129) : error C3861: 'rtERTExtModeStartMsg': identifier not found NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\cl.EXE"' : return code '0x2' Stop. The make command returned an error of 2

The model compiles without errors if the interface is set to "none".

I am using Matlab 2013a (Simulink 8.1). The compiler used is Microsoft Visual 2010 Professional.

1
I assume that by external interface you mean External Mode in this case. Are all the includes of your solution correct? You may have to include certain paths from the Matlab root.pmb
Yes, I do mean External Mode. I assume al the includes are correct. I have installed the paths to my target (WinAC). I did manage to get rid of one of the two "identifier not found" errors, so I guess it still is a Matlab "path" problem. But I do not know wich paths to include.Mark Hasselbach

1 Answers

0
votes

The issue has been resolved. For people who are facing the same problem: - The Siemens WinAC (example) documentation only uses Matlab2012b, consider compiling your model on the 2012b version of Matlab when you're using a different version;

  • In the Matlab Workspace cd your way to C:\Program Files\Siemens\WinAC\WinAC Target\WinAC Target Files and run the startup.m -file;

  • DO NOT change the current searchpath location;

  • DO NOT paste any other source files to this location otherwise you confuse the compiler wich file to take;

In my case I got the following errors:

    C:\PROGRA~1\Siemens\WinAC\WINACT~1\WINACT~1\src\WinLCReadWriteData.cpp(343) : error C2065: 'ODK_YEAR_MAX' : undeclared identifier 
C:\PROGRA~1\Siemens\WinAC\WINACT~1\WINACT~1\src\WinLCReadWriteData.cpp(343) : error C2065: 'ODK_YEAR_MIN' : undeclared identifier 
C:\PROGRA~1\Siemens\WinAC\WINACT~1\WINACT~1\src\WinLCReadWriteData.cpp(346) : error C2065: 'ODK_MON_MAX' : undeclared identifier 
C:\PROGRA~1\Siemens\WinAC\WINACT~1\WINACT~1\src\WinLCReadWriteData.cpp(346) : error C2065: 'ODK_MON_MIN' : undeclared identifier 
C:\PROGRA~1\Siemens\WinAC\WINACT~1\WINACT~1\src\WinLCReadWriteData.cpp(349) : error C2065: 'ODK_DAY_MAX' : undeclared identifier 
C:\PROGRA~1\Siemens\WinAC\WINACT~1\WINACT~1\src\WinLCReadWriteData.cpp(349) : error C2065: 'ODK_DAY_MIN' : undeclared identifier 
C:\PROGRA~1\Siemens\WinAC\WINACT~1\WINACT~1\src\WinLCReadWriteData.cpp(352) : error C2065: 'ODK_HOUR_MAX' : undeclared identifier 
C:\PROGRA~1\Siemens\WinAC\WINACT~1\WINACT~1\src\WinLCReadWriteData.cpp(352) : error C2065: 'ODK_HOUR_MIN' : undeclared identifier 
C:\PROGRA~1\Siemens\WinAC\WINACT~1\WINACT~1\src\WinLCReadWriteData.cpp(355) : error C2065: 'ODK_MIN_MAX' : undeclared identifier 
C:\PROGRA~1\Siemens\WinAC\WINACT~1\WINACT~1\src\WinLCReadWriteData.cpp(355) : error C2065: 'ODK_MIN_MIN' : undeclared identifier 
C:\PROGRA~1\Siemens\WinAC\WINACT~1\WINACT~1\src\WinLCReadWriteData.cpp(358) : error C2065: 'ODK_SEC_MAX' : undeclared identifier 
C:\PROGRA~1\Siemens\WinAC\WINACT~1\WINACT~1\src\WinLCReadWriteData.cpp(358) : error C2065: 'ODK_SEC_MIN' : undeclared identifier 
C:\PROGRA~1\Siemens\WinAC\WINACT~1\WINACT~1\src\WinLCReadWriteData.cpp(361) : error C2065: 'ODK_MILLI_MAX' : undeclared identifier 
C:\PROGRA~1\Siemens\WinAC\WINACT~1\WINACT~1\src\WinLCReadWriteData.cpp(361) : error C2065: 'ODK_MILLI_MIN' : undeclared identifier 
C:\PROGRA~1\Siemens\WinAC\WINACT~1\WINACT~1\src\WinLCReadWriteData.cpp(364) : error C2065: 'ODK_WDAY_MAX' : undeclared identifier 
C:\PROGRA~1\Siemens\WinAC\WINACT~1\WINACT~1\src\WinLCReadWriteData.cpp(364) : error C2065: 'ODK_WDAY_MIN' : undeclared identifier 
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\cl.EXE"' : return code '0x2' 
Stop.

To silence this error open the WinLCReadWriteData.cpp -file and comment out lines 343 to 365.

Now it compiles fine, without errors. External mode also works without issues.