From 70d1baf3042e27669aca6091c71c348f4945caa4 Mon Sep 17 00:00:00 2001 From: Nathanne Isip Date: Fri, 13 Dec 2024 19:54:31 +0800 Subject: [PATCH] Fixed implementation of VariableDeclarationExpression::loadNativeFunction() for Windows target. --- src/n8/ast/expression/VariableDeclarationExpression.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/n8/ast/expression/VariableDeclarationExpression.cpp b/src/n8/ast/expression/VariableDeclarationExpression.cpp index 1a59555..9b9218d 100644 --- a/src/n8/ast/expression/VariableDeclarationExpression.cpp +++ b/src/n8/ast/expression/VariableDeclarationExpression.cpp @@ -88,8 +88,11 @@ NativeFunction VariableDeclarationExpression::loadNativeFunction( #if defined(_WIN32) || defined(_WIN64) || defined(WIN32) || defined(WIN64) std::filesystem::path path(library); - std::string parentFolder = path.parent_path(); - std::wstring searchPath = parentFolder.wstring(); + std::filesystem::path searchFolder(path + .parent_path() + .string() + ); + std::wstring searchPath = searchFolder.wstring(); SetDllDirectoryW(searchPath.c_str()); handle = LoadLibraryA(library.c_str());