Plugin build error - DeMers Reflex Controller [SOLVED]
Posted: Fri Dec 27, 2019 4:01 pm
I am hitting an error when trying to build Matt DeMer's reflex muscle controller plugin from C++ source
I'm curious if anyone's ever built this successfully on Windows? Since Matt's GitHub instructions seem to suggest he did originally in Linux
https://github.com/msdemers/opensim-reflex-controllers
https://doi.org/10.1016/j.jbiomech.2016.11.002
Found a related forum post but doesnt look like they arrived at a solution either:
viewtopicPhpbb.php?f=91&t=7192&p=0&star ... 5f46d030b4
My current setup:
OpenSim 3.3 (although originally built for 3.2, Matt's last 2015 GitHub commit was supposed to be a patch for 3.3)
Windows 10.0.18362
Visual Studio 2015 v14.0.25431.01 Update 3
CMake 3.16.0
CMake Configure + Generate steps complete fine, but I get a Visual Studio LNK2001 "linker tool error" when executing ALL_BUILD in Release config, specifically 5 errors, 1 for each of the 5 .obj's
Example Error Code LNK2001
Arising from (I think) this declaration at start of each header file:
My debug steps so far (I am no C++ expert...):
1) google suggests this is caused by a missing or incorrect external function definition, the Controller class? But #include <OpenSim/Simulation/Control/Controller.h> is at start of each header, and I can see Controller.h listed in VS External Dependencies
2) Tried building and loading example plugins \OpenSim 3.3\sdk\APIExamples\Plugins\. All build and install without error
3) From the error syntax, it appears OSIMREFLEXES_API macro is being set to "__declspec(dllimport)" ?
But the logic in osimReflexesDLL.h Line 41 suggests it should be dllexport since OSIMREFLEXES_EXPORTS is defined on Line 22 of CMakeLists
I'm curious if anyone's ever built this successfully on Windows? Since Matt's GitHub instructions seem to suggest he did originally in Linux
https://github.com/msdemers/opensim-reflex-controllers
https://doi.org/10.1016/j.jbiomech.2016.11.002
Found a related forum post but doesnt look like they arrived at a solution either:
viewtopicPhpbb.php?f=91&t=7192&p=0&star ... 5f46d030b4
My current setup:
OpenSim 3.3 (although originally built for 3.2, Matt's last 2015 GitHub commit was supposed to be a patch for 3.3)
Windows 10.0.18362
Visual Studio 2015 v14.0.25431.01 Update 3
CMake 3.16.0
CMake Configure + Generate steps complete fine, but I get a Visual Studio LNK2001 "linker tool error" when executing ALL_BUILD in Release config, specifically 5 errors, 1 for each of the 5 .obj's
Example Error Code LNK2001
Code: Select all
unresolved external symbol "__declspec(dllimport) public: __cdecl OpenSim::Controller::Controller(class OpenSim::Controller &&)" (__imp_??0Controller@OpenSim@@QEAA@$$QEAV01@@Z)
Code: Select all
class OSIMREFLEXES_API ReflexController : public Controller {OpenSim_DECLARE_CONCRETE_OBJECT(ReflexController, Controller);
1) google suggests this is caused by a missing or incorrect external function definition, the Controller class? But #include <OpenSim/Simulation/Control/Controller.h> is at start of each header, and I can see Controller.h listed in VS External Dependencies
2) Tried building and loading example plugins \OpenSim 3.3\sdk\APIExamples\Plugins\. All build and install without error
3) From the error syntax, it appears OSIMREFLEXES_API macro is being set to "__declspec(dllimport)" ?
But the logic in osimReflexesDLL.h Line 41 suggests it should be dllexport since OSIMREFLEXES_EXPORTS is defined on Line 22 of CMakeLists