IBM Support

fake: multiple definition of Method(), Method() first defined here

Troubleshooting


Problem

When overriding TargetRTS methods in the model and the TargetRTS is built Flat, link errors similar to the following will occur. !> Linking T221_flat C:/Progra~1/Rational/RoseRe~1/C++/TargetRTS/lib/TORNADO22T.simnt-gnu-2.96Flat/libObjecTime.a(RTMain.o)(.text+0xa5c):fake: multiple definition of 'RTMain::targetShutdown(void)' Override.o:C:\RoseRTCases\C++\OverrideRTSMethodEx\T221_flat\build/C:\RoseRTCases\C++\OverrideRTSMethodEx\T221_flat\src\Override.cpp:12: first defined here

Cause

When the TargetRTS is built flat, there is one object file per TargetRTS class. The linker first links the object files in the model and then tries to link the TargetRTS libraries. This is when the error occurs.

Resolving The Problem

Rebuild the TargetRTS libraries in non-Flat mode. This will create one object file per TargetRTS method. The linker will now first link the object files in the model and then link the TargetRTS libraries which were archived with one object file per method. When the linker sees the method is already defined in the model, it won't be linked in from the TargetRTS libraries.


For more information on overriding TargetRTS methods in your model, see the online help:
C++ Reference --> Configuring and Customizing the Services Library --> Configuration and Customization --> Overriding Operations Within a Model





Related Information

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

Document Information

Modified date:
16 June 2018

UID

swg21176466