Troubleshooting
Problem
Generated code from a Simulink model can be successfully imported into a <SimulinkBlock> but the code will not compile within IBM Rational Rhapsody.
Symptom
This is following the workflow outlined in the IBM Rational Rhapsody documentation
Compiling the project afterwards results in the following compiler errors.
Please note, the name of the Simulink model is represented here as <simulink_model_name>
Building ------------ DefaultComponent.exe ------------
Executing: ""C:\Rhapsody8.1.3\Share"\etc\msvcmake.bat DefaultComponent.mak build x86 VC10 "
Setting environment for using Microsoft Visual Studio 2010 x86 tools.
class_0.cpp
c:\workspace\06622\importtest\project\defaultcomponent\defaultconfig\class_0.h(188) : error C2146: syntax error : missing ';' before identifier '<simulink_model_name>_B'
c:\workspace\06622\importtest\project\defaultcomponent\defaultconfig\class_0.h(188) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\workspace\06622\importtest\project\defaultcomponent\defaultconfig\class_0.h(188) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\workspace\06622\importtest\project\defaultcomponent\defaultconfig\class_0.h(190) : error C2143: syntax error : missing ';' before '*'
c:\workspace\06622\importtest\project\defaultcomponent\defaultconfig\class_0.h(190) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\workspace\06622\importtest\project\defaultcomponent\defaultconfig\class_0.h(190) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\workspace\06622\importtest\project\defaultcomponent\defaultconfig\class_0.h(192) : error C2146: syntax error : missing ';' before identifier '<simulink_model_name>_M_'
c:\workspace\06622\importtest\project\defaultcomponent\defaultconfig\class_0.h(192) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\workspace\06622\importtest\project\defaultcomponent\defaultconfig\class_0.h(192) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\workspace\06622\importtest\project\defaultcomponent\defaultconfig\class_0.h(194) : error C2146: syntax error : missing ';' before identifier '<simulink_model_name>_P'
c:\workspace\06622\importtest\project\defaultcomponent\defaultconfig\class_0.h(194) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\workspace\06622\importtest\project\defaultcomponent\defaultconfig\class_0.h(194) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\workspace\06622\importtest\project\defaultcomponent\defaultconfig\class_0.h(196) : error C2146: syntax error : missing ';' before identifier '<simulink_model_name>_U'
c:\workspace\06622\importtest\project\defaultcomponent\defaultconfig\class_0.h(196) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\workspace\06622\importtest\project\defaultcomponent\defaultconfig\class_0.h(196) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\workspace\06622\importtest\project\defaultcomponent\defaultconfig\class_0.h(198) : error C2146: syntax error : missing ';' before identifier '<simulink_model_name>_X'
c:\workspace\06622\importtest\project\defaultcomponent\defaultconfig\class_0.h(198) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\workspace\06622\importtest\project\defaultcomponent\defaultconfig\class_0.h(198) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\workspace\06622\importtest\project\defaultcomponent\defaultconfig\class_0.h(200) : error C2146: syntax error : missing ';' before identifier '<simulink_model_name>_Y'
c:\workspace\06622\importtest\project\defaultcomponent\defaultconfig\class_0.h(200) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\workspace\06622\importtest\project\defaultcomponent\defaultconfig\class_0.h(200) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
class_0.cpp(90) : error C2065: 'rtM' : undeclared identifier
class_0.cpp(90) : error C2351: obsolete C++ constructor initialization syntax
class_0.cpp(90) : error C2612: trailing '(' illegal in base/member initializer list
class_0.cpp(90) : error C2065: '<simulink_model_name>_M_' : undeclared identifier
class_0.cpp(90) : error C2143: syntax error : missing ';' before '{'
class_0.cpp(98) : error C2143: syntax error : missing ';' before '{'
class_0.cpp(102) : error C2601: 'class_0::SetValue' : local function definitions are illegal
class_0.cpp(108) : error C2601: 'class_0::doStep' : local function definitions are illegal
class_0.cpp(116) : error C2601: 'class_0::setPosition' : local function definitions are illegal
class_0.cpp(124) : error C2601: 'class_0::setVitesse' : local function definitions are illegal
class_0.cpp(132) : error C2601: 'class_0::getPosition_SP' : local function definitions are illegal
class_0.cpp(136) : error C2601: 'class_0::get_position_SP' : local function definitions are illegal
class_0.cpp(140) : error C2601: 'class_0::getVitesse_SP' : local function definitions are illegal
class_0.cpp(144) : error C2601: 'class_0::get_vitesse_SP' : local function definitions are illegal
class_0.cpp(148) : error C2601: 'class_0::getPosition' : local function definitions are illegal
class_0.cpp(152) : error C2601: 'class_0::getVitesse' : local function definitions are illegal
class_0.cpp(156) : error C2601: 'class_0::startBehavior' : local function definitions are illegal
class_0.cpp(162) : error C2601: 'class_0::getM_nSampleTime' : local function definitions are illegal
class_0.cpp(166) : error C2601: 'class_0::setM_nSampleTime' : local function definitions are illegal
class_0.cpp(170) : error C2601: 'class_0::initRelations' : local function definitions are illegal
class_0.cpp(176) : error C2601: 'class_0::initStatechart' : local function definitions are illegal
class_0.cpp(182) : error C2601: 'class_0::cancelTimeouts' : local function definitions are illegal
class_0.cpp(186) : error C2601: 'class_0::cancelTimeout' : local function definitions are illegal
class_0.cpp(196) : error C2601: 'class_0::rootState_entDef' : local function definitions are illegal
class_0.cpp(204) : error C2601: 'class_0::rootState_processEvent' : local function definitions are illegal
class_0.cpp(231) : fatal error C1004: unexpected end-of-file found
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
Build Done
[{"Line of Business":{"code":"LOB77","label":"Automation Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"ARM Category":[{"code":"a8m50000000CjWPAA0","label":"Rhapsody-\u003ECollaborations-\u003ESimulink"}],"ARM Case Number":"","Platform":[{"code":"PF033","label":"Windows"}],"Version":"All Version(s)"}]
Log InLog in to view more of this document
This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.
Was this topic helpful?
Document Information
Modified date:
27 May 2022
UID
swg21977644