Page 1 of 1

LNK2001 error when compiling TugOfWar example

Posted: Tue Jan 07, 2014 12:17 pm
by justinwager
I am having some trouble with the TugOfWar example, particularly the lines involving PrescribedController and Controller. I get the following error when I try to compile the code.

2>TugOfWar_Complete.obj : error LNK2001: unresolved external symbol "private: virtual void __thiscall OpenSim::Controller::constructProperties(void)" (?constructProperties@Controller@OpenSim@@EAEXXZ)

2>TugOfWar_Complete.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall OpenSim::PrescribedController::setupProperties(void)" (?setupProperties@PrescribedController@OpenSim@@MAEXXZ)

When I remove the section of the source code that defines the controls for the model, the code compiles, runs, and shows up in the OpenSim GUI without muscle controls. Adding the controls section back in causes the error.

I have both Controller.h and PrescribedController.h in my external dependencies.

Any help would be appreciated.

Thanks,
Justin

CMake 2.8.12.1
OpenSim 3.1
Visual C++ 2010 Express

Re: LNK2001 error when compiling TugOfWar example

Posted: Thu Jan 09, 2014 7:43 pm
by eskilan
Make sure you added all your additional library directories, additional include directories, and additional dependencies (.lib files)