Problem finishing the PingPong tutorial [message #1773520] |
Thu, 28 September 2017 15:02  |
Eclipse User |
|
|
|
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 13:05   |
Eclipse User |
|
|
|
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.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04382 seconds