From 12457f4ddcc01d6e0508beab0edfc9b663ba1fba Mon Sep 17 00:00:00 2001 From: gevorg Date: Fri, 16 Oct 2026 14:19:21 +0400 Subject: [PATCH] Link the C runtime statically The DLL linked the CRT dynamically (/MD), so Notepad++ could only load it where the VC++ Redistributable for the same architecture was installed. That's more likely to be missing for 32-bit and ARM64 users, and the ARM64 DLL is built with v145, so it needs version 14.50 or later. Use /MT and /MTd, as the Notepad++ plugin template does. The DLL now imports only Windows system DLLs. Release grows from 102 to 312 KB (x64) and from 94 to 263 KB (x86). Co-Authored-By: Claude Opus 5.5 --- LLMAssistant.vcxproj | 5 +++++ README.md | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/LLMAssistant.vcxproj b/LLMAssistant.vcxproj index 08979e1..5c280b4 100644 --- a/LLMAssistant.vcxproj +++ b/LLMAssistant.vcxproj @@ -84,6 +84,10 @@ Level3 true _DEBUG;LLMASSISTANT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + + MultiThreadedDebug true /utf-8 %(AdditionalOptions) $(ProjectDir)include;%(AdditionalIncludeDirectories) @@ -105,6 +109,7 @@ true true NDEBUG;LLMASSISTANT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + MultiThreaded true /utf-8 %(AdditionalOptions) $(ProjectDir)include;%(AdditionalIncludeDirectories) diff --git a/README.md b/README.md index 1614568..2669d42 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ The build script automatically: - Finds the newest Visual Studio with the C++ tools (using `vswhere`) - Sets up the build environment - Compiles with the project's platform toolset (v145), or with the newest installed toolset if v145 is missing (for example v143 on Visual Studio 2022) -- Links required Windows libraries +- Links required Windows libraries, and links the C/C++ runtime statically, so the DLL doesn't need the Visual C++ Redistributable installed `deploy.bat` builds the x64 DLL the same way, then copies it into `C:\Program Files\Notepad++\plugins\LLMAssistant\`. Run it as Administrator. It closes Notepad++ the same way its close button does, so unsaved files are handled as usual: Notepad++ asks whether to save them, or, if session snapshot is on, keeps them in its backup for the next start. It won't copy anything while Notepad++ is still open.