IBM Support

Errors generated when building with #define RTS_INLINES 0

Troubleshooting


Problem

Errors generated when building with #define RTS_INLINES 0

Resolving The Problem

SYMPTOM:

In the C++ Target Guide RTS_INLINES is defined as a configuration definition which controls whether Services Library header files define any inline functions.

When this configuration definition is specified as 0 the following errors are generated in the build log when building the model:

////////////////////////////////////////////
Compiling RTConnector/classData.cc
classData.cc
../src/RTConnector/classData.cc(64) : error C2079: 'rtg_class' uses
undefined struct 'RTActor_class'
../src/RTConnector/classData.cc(64) : error C2373: 'public: static struct
RTActor_class const RTConnector_Actor::rtg_class' : redefinition; different
type modifiers
../include\RTConnector.h(74) : see declaration of 'public: static struct
RTActor_class const RTConnector_Actor::rtg_class'
../src/RTConnector/classData.cc(65) : error C2552: 'public: static struct
RTActor_class const RTConnector_Actor::rtg_class' : non-aggregates cannot
be initialized with initializer list
../src/RTConnector/classData.cc(79) : error C2146: syntax error : missing
')' before identifier 'RTPortDescriptor'
../src/RTConnector/classData.cc(79) : error C2065: 'RTPortDescriptor' :
undeclared identifier
../src/RTConnector/classData.cc(79) : error C2059: syntax error : ')'
../src/RTConnector/classData.cc(82) : error C2146: syntax error : missing
')' before identifier 'RTLocalBindingDescriptor'
../src/RTConnector/classData.cc(82) : error C2065:
'RTLocalBindingDescriptor' : undeclared identifier
../src/RTConnector/classData.cc(82) : error C2059: syntax error : ')'
../src/RTConnector/classData.cc(85) : error C2146: syntax error : missing
')' before identifier 'RTFieldDescriptor'
../src/RTConnector/classData.cc(85) : error C2065: 'RTFieldDescriptor' :
undeclared identifier
../src/RTConnector/classData.cc(85) : error C2059: syntax error : ')'
../src/RTConnector/classData.cc(86) : error C2262: 'public: static struct
RTActor_class const RTConnector_Actor::rtg_class' : cannot be destroyed
NMAKE : fatal error U1077: 'cl' : return code '0x2'
////////////////////////////


CAUSE:

Missing dependencies.


RESOLUTION:

The problem will be fixed in the next release. The work around is to open the file %ROSERT_HOME%/C++/TargetRTS/src/RTConnector/classData.cc and add the following line:

#include <RTActor_class.h>

save the file and open %ROSERT_HOME%/C++/TargetRTS/src/RTTimerList/dt.cc and add the following line:

#include <RTTimerList.inl>

Follow the instructions on building the Services Library found at the end of Chapter 4 of the C++ Target Guide.

For example on WinNT 4.0 with Microsoft Visual C++ 6.0 RTS_INLINES 0:
1. Copy the directory %ROSERT_HOME%\C++\TargetRTS\libset\x86-VisualC++-6.0 as %ROSERT_HOME%\C++\TargetRTS\libset\x86-VisualC++-6.0-INLINES0.

2. Modify the RTLibSet.h file to include the line:
#define RTS_INLINES 0

3. Copy the directory %ROSERT_HOME%\C++\TargetRTS\config\NT40T.x86-VisualC++-6.0 as %ROSERT_HOME%\C++\TargetRTS\config\NT40T.x86-VisualC++-6.0-INLINES0.

4. [Optional] If you want to make these changes for one target only, create directories RTTimerList and RTConnector in %ROSERT_HOME%\C++\TargetRTS\src\target\NT40 and copy the two files below into their respective directories. The changes to the files can then be made there.

5. Modify the file %ROSERT_HOME%/C++/TargetRTS/src/RTConnector/classData.cc to include the line:
#include <RTActor_class.h>

6. Modify the file %ROSERT_HOME%/C++/TargetRTS/src/RTTimerList/dt.cc to include the line:
#include <RTTimerList.inl>
Note:
If you don't make this change you will see errors similar to the ones below when compiling your model.

!> Compiling NTComponent
NTComponent.cpp
!> Linking Hello.EXE
libObjecTime.LIB(aon.OBJ) : error LNK2001: unresolved external symbol "public: int __thiscall RTTimerList::length(void)const " (?length@RTTimerList@@QBEHXZ)
libObjecTime.LIB(aoo.OBJ) : error LNK2001: unresolved external symbol "public: int __thiscall RTTimerList::length(void)const " (?length@RTTimerList@@QBEHXZ)
libObjecTime.LIB(aop.OBJ) : error LNK2001: unresolved external symbol "public: int __thiscall RTTimerList::length(void)const " (?length@RTTimerList@@QBEHXZ)
libObjecTime.LIB(apn.OBJ) : error LNK2001: unresolved external symbol "public: __thiscall RTTimerList::Link::Link(void)" (??0Link@RTTimerList@@QAE@XZ)
Hello.EXE : fatal error LNK1120: 2 unresolved externals

7. Open a CMD prompt.

8. use the command 'cd' to change directories to %ROSERT_HOME%\C++\TargetRTS\src

9. build the Services Library with the command:
nmake CONFIG=NT40T.x86-VisualC++-6.0-INLINES0

10. change the TargetConfiguration to NT40T.x86-VisualC++-6.0-INLINES0 on the "C++ Compilation" tab of the Component specification window.

11. re-build your model.





[{"Product":{"code":"SSSHKL","label":"Rational Rose RealTime"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"--","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"2000.02.10.149.000","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Historical Number

12571

Document Information

Modified date:
16 June 2018

UID

swg21123587