Troubleshooting
Problem
Link errors occur when building a model with class state machines: "Undefined first referenced symbol/unresolved external symbol: RTstruct_encode and RTstruct_decode"
Resolving The Problem
SYMPTOM:
When building a Rose RealTime model with class state machines, link errors involving RTstruct_encode and RTstruct_decode occur, similar to the following:
Target = NT40T.x86-VisualC++-6.0:
!> Linking RegenMgr1.EXE Hardware.OBJ : error LNK2001: unresolved external symbol "int __cdecl RTstruct_encode(struct RTObject_class const *,void const *,class RTEncoding *)" (?RTstruct_encode@@YAHPBURTObject_class@@PBXPAVRTEncoding@@@Z) RegenMgr.OBJ : error LNK2001: unresolved external symbol "int __cdecl RTstruct_encode(struct RTObject_class const *,void const *,class RTEncoding *)" (?RTstruct_encode@@YAHPBURTObject_class@@PBXPAVRTEncoding@@@Z) Hardware.OBJ : error LNK2001: unresolved external symbol "int __cdecl RTstruct_decode(struct RTObject_class const *,void *,class RTDecoding *)" (?RTstruct_decode@@YAHPBURTObject_class@@PAXPAVRTDecoding@@@Z) RegenMgr.OBJ : error LNK2001: unresolved external symbol "int __cdecl RTstruct_decode(struct RTObject_class const *,void *,class RTDecoding *)" (?RTstruct_decode@@YAHPBURTObject_class@@PAXPAVRTDecoding@@@Z) RegenMgr1.EXE : fatal error LNK1120: 2 unresolved externals NMAKE : warning U4010: 'RegenMgr1.EXE' : build failed; /K specified, continuing ... NMAKE : warning U4011: 'RTcompile' : not all dependents available; target not built NMAKE : fatal error U1077: 'rtperl' : return code '0x100' Stop. Error: Build failed status 2 Build failed.
Target = SUN5T.sparc-gnu-2.95.1:
!> Linking RegenMgr1 Undefined first referenced symbol in file RTstruct_encode(RTObject_class const *, void const *, RTEncoding *)Hardware.o RTstruct_decode(RTObject_class const *, void *, RTDecoding *)Hardware.o ld: fatal: Symbol referencing errors. No output written to RegenMgr1 collect2: ld returned 1 exit status *** Error code 1 The following command caused the error: rtperl "/RoseRT6.4.356.0-GA-04/RoseRT/C++/TargetRTS/codegen/rtlink.pl" -vendor gnu -exe "RegenMgr1" -componentname RegenMgr1 -- \ g++ Hardware.o Main.o RegenMgr.o RTSystem/RegenMgr1.o -o RegenMgr1 make: Warning: Target `RTcompile' not remade because of errors Current working directory /home/RegenMgr1/build Error: Build failed status ffffffff Build failed.CAUSE: RTstruct_encode and RTstruct_decode link errors occur when the "GenerateDescriptor" field is incorrectly set to "True" in the "C++ TargetRTS" tab of a class specification. RESOLUTION: To overcome the link errors, set the "GenerateDescriptor" field to "False" in the "C++ TargetRTS" tab in the offending class specifications, and rebuild the model.
[{"Product":{"code":"SSSHKL","label":"Rational Rose RealTime"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"--","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"2002.05.20","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]
Historical Number
152772907
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21131968