Problem finishing the PingPong tutorial [message #1773520] |
Thu, 28 September 2017 19:02 |
Michalis Famelis Messages: 4 Registered: September 2017 |
Junior Member |
|
|
Hello,
I'm new to Papyrus-RT and I've been trying to follow the PingPong tutorial on the wiki:
https://wiki.eclipse.org/Papyrus-RT/User/User_Guide/Getting_Started
I'm having trouble compiling the generated code at the last step and I want to see if that's my fault (e.g. setting up my environment) or there's something in the tutorial that needs to be updated.
I'm using the RCP version. My compilation environment is Windows/Cygwin. I've installed all prerequisites according to this page:
https://wiki.eclipse.org/Papyrus-RT/User_Guide/Cygwin_Setup
I've made sure to use cygwin's cmake, and I don't have MinGW. I'm using cygwin's g++ (GCC) 6.4.0.
At the last step of the tutorial, I used these directions to compile the generated code:
https://wiki.eclipse.org/Papyrus-RT/User_Guide/Compiling_and_running_Papyrus_for_Real_Time_applications#Building_your_applications_on_Windows_with_Cygwin
Then I get the following errors:
/home/user/workspace/papyrusrt/PingPong_CDTProject/src/Pinger.cc: In function 'void instantiate_Pinger(const UMLRTRtsInterface*, UMLRTSlot*, const UMLRTCommsPort**)':
/home/user/workspace/papyrusrt/PingPong_CDTProject/src/Pinger.cc:87:88: error: invalid new-expression of abstract class type 'Capsule_Pinger'
slot->capsule = new Capsule_Pinger(&Pinger, slot, borderPorts, internalPorts, false);
^
In file included from /home/user/workspace/papyrusrt/PingPong_CDTProject/src/Pinger.cc:2:0:
/home/user/workspace/papyrusrt/PingPong_CDTProject/src/Pinger.hh:12:7: note: because the following virtual functions are pure within 'Capsule_Pinger':
class Capsule_Pinger : public UMLRTCapsule
^~~~~~~~~~~~~~
In file included from /home/user/workspace/papyrusrt/PingPong_CDTProject/src/Pinger.hh:6:0,
from /home/user/workspace/papyrusrt/PingPong_CDTProject/src/Pinger.cc:2:
/cygdrive/c/Users/user/Downloads/org.eclipse.papyrusrt.rcp.product-win32.win32.x86_64/Papyrus-RT/plugins/org.eclipse.papyrusrt.rts_1.0.0.201707181457/umlrts/include/umlrtcapsule.hh:39:18: note: virtual void UMLRTCapsule::initialize(const UMLRTMessage&)
virtual void initialize ( const UMLRTMessage & msg ) = 0;
^~~~~~~~~~
/cygdrive/c/Users/user/Downloads/org.eclipse.papyrusrt.rcp.product-win32.win32.x86_64/Papyrus-RT/plugins/org.eclipse.papyrusrt.rts_1.0.0.201707181457/umlrts/include/umlrtcapsule.hh:40:18: note: virtual void UMLRTCapsule::inject(const UMLRTMessage&)
virtual void inject ( const UMLRTMessage & msg ) = 0;
^~~~~~
make[2]: *** [CMakeFiles/TopMain.dir/build.make:111: CMakeFiles/TopMain.dir/Pinger.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:105: CMakeFiles/TopMain.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
Am I doing something wrong or should the tutorial be updated?
|
|
|
|
|
|
Re: Problem finishing the PingPong tutorial [message #1773584 is a reply to message #1773570] |
Fri, 29 September 2017 17:05 |
Michalis Famelis Messages: 4 Registered: September 2017 |
Junior Member |
|
|
I had actually not set up UMLRTS_ROOT. Reading the contents of the page you sent me I'd mistakenly thought I could jump straight to https://wiki.eclipse.org/Papyrus-RT/User_Guide/Compiling_and_running_Papyrus_for_Real_Time_applications#Building_your_applications_on_Windows_with_Cygwin
So, now I've correctly set up UMLRTS_ROOT. And here is g++:
$ g++ --version
g++ (GCC) 6.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
BUT
The problem still persists. I think that before I short-circuited the UMLRTS_ROOT problem with this hack: https://wiki.eclipse.org/index.php?title=Papyrus-RT%2FUser_Guide%2FCompiling_and_running_Papyrus_for_Real_Time_applications&type=revision&diff=419649&oldid=418551
So, I still have the same problem. Looking at the compiler messages, it just seems that the code generator generates the Pinger as abstract, even though it's not declared as such (see the attached model):
Pinger.cc:87:90: error: invalid new-expression of abstract class type 'Capsule_Pinger'
slot->capsule = new Capsule_Pinger( &Pinger, slot, borderPorts, internalPorts, false );
Pinger.hh:12:7: note: because the following virtual functions are pure within 'Capsule_Pinger':
class Capsule_Pinger : public UMLRTCapsule
umlrtcapsule.hh:39:18: note: virtual void UMLRTCapsule::initialize(const UMLRTMessage&)
virtual void initialize ( const UMLRTMessage & msg ) = 0;
^~~~~~~~~~
umlrtcapsule.hh:40:18: note: virtual void UMLRTCapsule::inject(const UMLRTMessage&)
virtual void inject ( const UMLRTMessage & msg ) = 0;
I'm attaching you the model and generated code, just in case I've done something wrong while following the tutorial.
|
|
|
Re: Problem finishing the PingPong tutorial [message #1773586 is a reply to message #1773584] |
Fri, 29 September 2017 17:48 |
Michalis Famelis Messages: 4 Registered: September 2017 |
Junior Member |
|
|
Ernesto, I just deleted the generated code project.
I then right clicked on the capsule Top and selected "Generate with this capsule as top".
This must have regenerated the whole thing from scratch.
Then switched to cygwin, went into the generated project, created a folder "build".
Then inside build I ran: cmake ../src
Then still from inside build, I ran: make
And I'm getting the same error.
[Updated on: Fri, 29 September 2017 17:49] Report message to a moderator
|
|
|
Re: Problem finishing the PingPong tutorial [message #1773588 is a reply to message #1773586] |
Fri, 29 September 2017 18:12 |
Ernesto Posse Messages: 438 Registered: March 2011 |
Senior Member |
|
|
Hmm... strange.
A couple of things:
1) can you type in the Cygwin terminal
echo $UMLRTS_ROOT
and report it here?
2) can you try regenerating by deleting the CDT project, and then right-click on the root model element (PingPong) and then selecting "(Re)Generate all code" and see if it gives you the same error?
3) what version of Java do you have?
4) can you go to Help->About Papyrus-RT->Installation Details, unfold Papyrus for Real-Time and expand the Version column to ensure that we see the full version numbers and post it here? Also post the contents of the Configuration tab.
[Updated on: Fri, 29 September 2017 18:24] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05335 seconds