Building of model by using Friend stereotype in Rational Rhapsody results in "not allowed outside of a class definition" error
Attempts to build a model by using the Friend stereotype in IBM Rational Rhapsody results in the error "not allowed outside of a class definition".
Attempts to build a model having friend stereotype along with usage(Implementation) stereotype on the same dependency link in Rational Rhapsody results in the following error:
"C2255: 'friend' : not allowed outside of a class definition"
Incorrect code generation. The friend statement is not being generated in the final code.
Resolving the problem
To resolve this issue, create a separate dependency for the friend stereotype between the two classes to get the error free code by following the steps below:
- Develop a model in Rational Rhapsody with two classes(class_0 and class_1)
- Add dependency between the classes with stereotype as usage(Implementation)
- Add a separate dependency with friend stereotype
- Generate code for the model and build
More support for:
Rational Rhapsody Developer
Software version: 7.5, 18.104.22.168, 7.5.1, 22.214.171.124, 7.5.2, 126.96.36.199, 7.5.3, 188.8.131.52, 184.108.40.206, 7.6, 220.127.116.11, 7.6.1
Operating system(s): Windows
Reference #: 1599964
Modified date: 06 July 2012