diff --git a/OpenSim/Simulation/SimbodyEngine/Test/testJoints.cpp b/OpenSim/Simulation/SimbodyEngine/Test/testJoints.cpp index 4b9121fce5..d0888ff44e 100644 --- a/OpenSim/Simulation/SimbodyEngine/Test/testJoints.cpp +++ b/OpenSim/Simulation/SimbodyEngine/Test/testJoints.cpp @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include @@ -69,6 +68,7 @@ #include #include #include +#include #include #include @@ -2059,9 +2059,12 @@ TEST_CASE("testEquivalentBodyForceFromGeneralizedForce") { "===" << endl; - // Need to load osim actuators because the following model has - // Actuators that will fail to register and the model will not load. - LoadOpenSimLibrary("osimActuators"); + // The following model(s) contains Actuators that are registered when the + // osimActuators library is loaded. But unless we call at least one + // function defined in the osimActuators library, some linkers will omit + // its dependency from the executable and it will not be loaded at + // startup. + { PointActuator t; } Model gaitModel("testJointConstraints.osim"); diff --git a/OpenSim/Simulation/Test/testInitState.cpp b/OpenSim/Simulation/Test/testInitState.cpp index f959e87336..0d00938710 100644 --- a/OpenSim/Simulation/Test/testInitState.cpp +++ b/OpenSim/Simulation/Test/testInitState.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include @@ -41,7 +41,14 @@ using namespace std; TEST_CASE("testStates") { using namespace SimTK; - LoadOpenSimLibrary("osimActuators"); + + // The following model(s) contains Actuators that are registered when the + // osimActuators library is loaded. But unless we call at least one + // function defined in the osimActuators library, some linkers will omit + // its dependency from the executable and it will not be loaded at + // startup. + { PointActuator t; } + //========================================================================== // Setup OpenSim model std::string modelFile = "arm26.osim"; diff --git a/OpenSim/Simulation/Test/testModelInterface.cpp b/OpenSim/Simulation/Test/testModelInterface.cpp index 1500021508..16c2743728 100644 --- a/OpenSim/Simulation/Test/testModelInterface.cpp +++ b/OpenSim/Simulation/Test/testModelInterface.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include @@ -37,7 +37,12 @@ void testModelTopologyErrors(); void testDoesNotSegfaultWithUnusualConnections(); int main() { - LoadOpenSimLibrary("osimActuators"); + // The following model(s) contains Actuators that are registered when the + // osimActuators library is loaded. But unless we call at least one + // function defined in the osimActuators library, some linkers will omit + // its dependency from the executable and it will not be loaded at + // startup. + { PointActuator t; } SimTK_START_TEST("testModelInterface"); SimTK_SUBTEST(testModelFinalizePropertiesAndConnections); diff --git a/OpenSim/Simulation/Test/testMomentArms.cpp b/OpenSim/Simulation/Test/testMomentArms.cpp index ab9af57578..20c8a02212 100644 --- a/OpenSim/Simulation/Test/testMomentArms.cpp +++ b/OpenSim/Simulation/Test/testMomentArms.cpp @@ -37,7 +37,6 @@ #include #include #include -#include #include "SimulationComponentsForTesting.h" @@ -59,7 +58,6 @@ void testMomentArmsAcrossCompoundJoint(); int main() { clock_t startTime = clock(); - LoadOpenSimLibrary("osimActuators"); Object::registerType(CompoundJoint()); try { diff --git a/OpenSim/Simulation/Test/testSimulationUtilities.cpp b/OpenSim/Simulation/Test/testSimulationUtilities.cpp index 4dc7cb895c..c3c816c17f 100644 --- a/OpenSim/Simulation/Test/testSimulationUtilities.cpp +++ b/OpenSim/Simulation/Test/testSimulationUtilities.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include using namespace OpenSim; using namespace std; @@ -33,7 +33,12 @@ using namespace std; void testUpdatePre40KinematicsFor40MotionType(); int main() { - LoadOpenSimLibrary("osimActuators"); + // The following model(s) contains Actuators that are registered when the + // osimActuators library is loaded. But unless we call at least one + // function defined in the osimActuators library, some linkers will omit + // its dependency from the executable and it will not be loaded at + // startup. + { PointActuator t; } SimTK_START_TEST("testSimulationUtilities"); SimTK_SUBTEST(testUpdatePre40KinematicsFor40MotionType); diff --git a/OpenSim/Simulation/Test/testStatesTrajectory.cpp b/OpenSim/Simulation/Test/testStatesTrajectory.cpp index aa150dc55a..fb5dad9b34 100644 --- a/OpenSim/Simulation/Test/testStatesTrajectory.cpp +++ b/OpenSim/Simulation/Test/testStatesTrajectory.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include #include @@ -776,10 +776,13 @@ void testExport() { int main() { SimTK_START_TEST("testStatesTrajectory"); - // actuators library is not loaded automatically (unless using clang). - #if !defined(__clang__) - LoadOpenSimLibrary("osimActuators"); - #endif + + // The following model(s) contains Actuators that are registered when the + // osimActuators library is loaded. But unless we call at least one + // function defined in the osimActuators library, some linkers will omit + // its dependency from the executable and it will not be loaded at + // startup. + { PointActuator t; } // Make sure the states Storage file doesn't already exist; we'll // generate it later and we don't want to use a stale one by accident.