5
5
Author(s): Min Yang Jung
6
6
Created on: 2009-12-07
7
7
8
- (C) Copyright 2009-2020 Johns Hopkins University (JHU), All Rights Reserved.
8
+ (C) Copyright 2009-2024 Johns Hopkins University (JHU), All Rights Reserved.
9
9
10
10
--- begin cisst license - do not edit ---
11
11
@@ -20,6 +20,7 @@ no warranty. The complete license can be found in license.txt and
20
20
21
21
#include < cisstCommon/cmnThrow.h>
22
22
#include < cisstCommon/cmnPath.h>
23
+ #include < cisstCommon/cmnPortability.h>
23
24
#include < cisstOSAbstraction/osaSleep.h>
24
25
#include < cisstOSAbstraction/osaGetTime.h>
25
26
#include < cisstOSAbstraction/osaSocket.h>
@@ -905,15 +906,19 @@ mtsComponent * mtsManagerLocal::CreateComponentDynamicallyJSON(const std::string
905
906
{
906
907
// -1- try to dynamically load the library if specified
907
908
if (!sharedLibrary.empty ()) {
908
- // create load and path based on LD_LIBRARY_PATH
909
+ // create load and path based on LD_LIBRARY_PATH (or PATH on Windows)
909
910
osaDynamicLoader loader;
910
911
std::string fullPath;
911
912
// check if the file already exists, i.e. use provided a full path
912
913
if (cmnPath::Exists (sharedLibrary)) {
913
914
fullPath = sharedLibrary;
914
915
} else {
915
916
cmnPath path;
917
+ #if (CISST_OS == CISST_WINDOWS)
918
+ path.AddFromEnvironment (" PATH" );
919
+ #else
916
920
path.AddFromEnvironment (" LD_LIBRARY_PATH" );
921
+ #endif
917
922
fullPath = path.Find (cmnPath::SharedLibrary (sharedLibrary));
918
923
if (fullPath.empty ()) {
919
924
fullPath = sharedLibrary;
0 commit comments