I have a problem when I want to generate code from Matlab/Simulink with real time workshop for a model: MIRCOS 167 The following is what Matlab says to me: ### Starting Real-Time Workshop build procedure for model: c166test ### Generating code into build directory: .\c166test_c167_rtw ### Invoking Target Language Compiler on c166test.rtw tlc -r .\c166test_c167_rtw\c166test.rtw 'd:\MATLAB6p5p1\work\c167.tlc' -O.\c166test_c167_rtw '-Id:\MATLAB6p5p1\work' '-ID:\MATLAB6p5P1\rtw\c\tlc\mw' '-ID:\MATLAB6p5P1\rtw\c\tlc\lib' '-ID:\MATLAB6p5P1\rtw\c\tlc\blocks' '-ID:\MATLAB6p5P1\rtw\c\tlc\fixpt' -aEnforceIntegerDowncast=1 -aFoldNonRolledExpr=1 -aForceParamTrailComments=0 -aGenerateComments=1 -aGenerateReport=0 -aIncDataTypeInIds=0 -aIncHierarchyInIds=0 -aInlineInvariantSignals=0 -aInlineParameters=0 -aInlinedPrmAccess="Literals" -aLocalBlockOutputs=1 -aMaxRTWIdLen=31 -aMem_Mod="Compact" -aPrefixModelToSubsysFcnNames=1 -aRTWVerbose=1 -aRollThreshold=5 -aShowEliminatedStatements=0 -aTiming=0 -aReleaseVersion=13.1 -p10000 ### Loading TMW TLC function libraries ... ### Initial pass through model to cache user defined code ### Caching model source code .... ### Writing source file c166test.c ### Writing header file c166test.h ### Writing header file c166test_types.h . ### Writing header file c166test_private.h ### Writing source file c166test_data.c ### TLC code generation complete. ### c166test.mk which is generated from D:\MATLAB6p5P1\toolbox\c167\bin\c167.tmf is up to date ### Wrapping unrecognized make command (angle brackets added) ### <D:\MATLAB6p5P1\toolbox\c167\bin\gmake.exe> ### in default batch file ### Building c166test: .\c166test.bat d:\MATLAB6p5p1\work\c166test_c167_rtw>set MATLAB=D:\MATLAB6p5P1 d:\MATLAB6p5p1\work\c166test_c167_rtw>D:\MATLAB6p5P1\toolbox\c167\bin\gmake.exe -f c166test.mk ADD_MDL_NAME_TO_GLOBALS=1 BEFORE .c.obj (c166test.c) Compiling (g166-cc1): c166test.c D:\Keil\C166\bin\c166 @D:\MATLAB6p5P1\work\c166test_c167_rtw\c166test.cmd C166 COMPILER V4.25 - SN: K6DZP-W4YZ5E COPYRIGHT KEIL ELEKTRONIK GmbH 1991 - 2003 *** WARNING C138 IN LINE 57 OF C166TEST.C: expression with possibly no effect *** WARNING C138 IN LINE 86 OF C166TEST.C: expression with possibly no effect C166 COMPILATION COMPLETE. 2 WARNING(S), 0 ERROR(S) D:\MATLAB6p5P1\toolbox\c167\bin\gmake.exe: [c166test.obj] Error 1 (ignored) .c.obj (c166test_data.c) Compiling (g166-cc1): c166test_data.c D:\Keil\C166\bin\c166 @D:\MATLAB6p5P1\work\c166test_c167_rtw\c166test_data.cmd C166 COMPILER V4.25 - SN: K6DZP-W4YZ5E COPYRIGHT KEIL ELEKTRONIK GmbH 1991 - 2003 C166 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S) {D:\MATLAB6p5P1/rtw/c/libsrc/} (rt_logging) Compiling (g166-cc1): rt_logging D:\Keil\C166\bin\c166 @D:\MATLAB6p5P1\work\c166test_c167_rtw\rt_logging.cmd C166 COMPILER V4.25 - SN: K6DZP-W4YZ5E COPYRIGHT KEIL ELEKTRONIK GmbH 1991 - 2003 *** WARNING C192 IN LINE 774 OF D:\MATLAB6P5P1/RTW/C/LIBSRC/RT_LOGGING.C: 'parameter 3': value truncated *** WARNING C192 IN LINE 783 OF D:\MATLAB6P5P1/RTW/C/LIBSRC/RT_LOGGING.C: 'parameter 3': value truncated *** WARNING C192 IN LINE 790 OF D:\MATLAB6P5P1/RTW/C/LIBSRC/RT_LOGGING.C: 'parameter 3': value truncated *** WARNING C192 IN LINE 821 OF D:\MATLAB6P5P1/RTW/C/LIBSRC/RT_LOGGING.C: '=': value truncated *** ERROR C67 IN LINE 1049 OF D:\MATLAB6P5P1/RTW/C/LIBSRC/RT_LOGGING.C: 'real64_T': undefined identifier C166 COMPILATION COMPLETE. 4 WARNING(S), 1 ERROR(S) D:\MATLAB6p5P1\toolbox\c167\bin\gmake.exe: [rt_logging.o] Error 2 (ignored) Creating or updating the real-time library... (compact memory model) D:\Keil\C166\bin\lib166 CREATE D:\MATLAB6p5P1\toolbox\c167\rtc167\LIBRTC167_C.LIB LIB166 LIBRARY MANAGER V4.24 COPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 2002 D:\Keil\C166\bin\lib166 ADD D:\MATLAB6p5P1\toolbox\c167/rtc167/c/rt_nrand.o, D:\MATLAB6p5P1\toolbox\c167/rtc167/c/rt_urand.o, D:\MATLAB6p5P1\toolbox\c167/rtc167/rt_dummy.o TO D:\MATLAB6p5P1\toolbox\c167\rtc167\LIBRTC167_C.LIB LIB166 LIBRARY MANAGER V4.24 COPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 2002 D:\Keil\C166\bin\lib166 ADD D:\MATLAB6p5P1\toolbox\c167/rtc167/c/rt_atan2.o, D:\MATLAB6p5P1\toolbox\c167/rtc167/c/rt_atan232.o, ............................... D:\MATLAB6p5P1\toolbox\c167/rtc167/rt_dummy2.o TO D:\MATLAB6p5P1\toolbox\c167\rtc167\LIBRTC167_C.LIB LIB166 LIBRARY MANAGER V4.24 COPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 2002 *** ERROR 224: ATTEMPT TO ADD DUPLICATE MODULE FILE: D:\MATLAB6P5P1\TOOLBOX\C167/RTC167/C/RT_FORWARDSUBCC_SGL.O MODULE: MATLAB6P5P1_RTW_C_LIBSRC_RT_FORWARDSUBCC_ D:\MATLAB6p5P1\toolbox\c167\bin\gmake.exe: *** [LIBRTC167_C.LIB] Error 3