C++ error ‘cannot instantiate abstract class’ when building the code of SpineBushing plugin (original for OpenSim v2.4)

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Wei Wang
Posts: 8
Joined: Thu Sep 29, 2016 8:24 am

C++ error ‘cannot instantiate abstract class’ when building the code of SpineBushing plugin (original for OpenSim v2.4)

Post by Wei Wang » Thu Dec 28, 2017 12:43 pm

Dear all,

I am trying to build a SpineBushing plugin ( https://simtk.org/projects/spinebushing). It was created for OpenSim 2.4, so I have to rebuild it for the current v3.3. However, I met errors like below. It seems that current OpenSim library does not support the old code anymore. Does anybody know what could I do. Thanks!

Error 1 error C2259: 'OpenSim::SpineBushingTest' : cannot instantiate abstract class
Error 2 error C2248: 'OpenSim::Force::copyData' : cannot access private member declared in
Error 3 error C3861: 'setType': identifier not found
Error 4 error C2039: 'setup' : is not a member of 'OpenSim::Force'
Error 5 error C2039: 'createSystem' : is not a member of 'OpenSim::Force'
6 IntelliSense: object of abstract class type "OpenSim::SpineBushingTest" is not allowed:
pure virtual function "OpenSim::Force::clone" has no overrider
pure virtual function "OpenSim::Force::getConcreteClassName" has no overrider
7 IntelliSense: function "OpenSim::Force::copyData" (declared at line 221 of "C:\OpenSim 3.3\sdk\include\OpenSim/Simulation/Model/Force.h") is inaccessible
8 IntelliSense: identifier "setType" is undefined
9 IntelliSense: class "OpenSim::Force" has no member "setup"
10 IntelliSense: class "OpenSim::Force" has no member "createSystem"


Best regards,
Echo

User avatar
Wei Wang
Posts: 8
Joined: Thu Sep 29, 2016 8:24 am

Re: C++ error ‘cannot instantiate abstract class’ when building the code of SpineBushing plugin (original for OpenSim v2

Post by Wei Wang » Thu Dec 28, 2017 1:47 pm

Hi,

Sorry I forgot to say, the authors of SpineBushing element provided the compiled *.dll (Visual Studio Express 2010 using CMake2.8 for OpenSim version 2.4.0.). But no matter I loaded the plugin on OpenSim 2.4 or OpenSim 3.3, both of the message boxes said: ‘Error trying to load library SpineBushingTest. Library not loaded’.

Echo

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: C++ error ‘cannot instantiate abstract class’ when building the code of SpineBushing plugin (original for OpenSim v2

Post by Dimitar Stanev » Sat Dec 30, 2017 3:41 am

Hi,

Probably some of the derived methods do not agree with the current version of OpenSim. A lot has changed and many methods were removed or renamed. You can try to see the code and understand why you get the errors and find the corresponding methods in the new API.

https://simtk.org/api_docs/opensim/api_docs/

Best

POST REPLY