Fix Window search path for ANSLIB
This commit is contained in:
@@ -7,10 +7,27 @@
|
||||
namespace ANSCENTER
|
||||
{
|
||||
ANSLIB::ANSLIB() {
|
||||
// Pre-load all ANSCORE DLLs from the Shared folder using full paths.
|
||||
// This ensures the correct versions are loaded regardless of PATH order
|
||||
// (e.g., DLHUB_Runtime_Engine may contain older copies on some machines).
|
||||
// Once loaded, Windows reuses them for all subsequent implicit dependencies.
|
||||
const char* sharedDir = "C:\\ProgramData\\ANSCENTER\\Shared\\";
|
||||
const char* preloadDlls[] = {
|
||||
"ANSLicensingSystem.dll",
|
||||
"anslicensing.dll",
|
||||
"ANSMOT.dll",
|
||||
"ANSODEngine.dll",
|
||||
nullptr
|
||||
};
|
||||
for (int i = 0; preloadDlls[i] != nullptr; i++) {
|
||||
std::string fullPath = std::string(sharedDir) + preloadDlls[i];
|
||||
LoadLibraryA(fullPath.c_str());
|
||||
}
|
||||
|
||||
// Ensure all shared DLLs (OpenCV, OpenVINO, TRT, ORT) are pre-loaded
|
||||
ANSCENTER::ANSLibsLoader::Initialize();
|
||||
|
||||
const char* dllPath = "C:\\ProgramData\\ANSCENTER\\Shared\\ANSODEngine.dll"; // Hardcoded path
|
||||
const char* dllPath = "C:\\ProgramData\\ANSCENTER\\Shared\\ANSODEngine.dll";
|
||||
dllHandle = LoadLibraryA(dllPath);
|
||||
if (!dllHandle) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user