Add DLL lib subdirectory lookup on Windows#47
Conversation
Agent-Logs-Url: https://github.com/veritaware/Besprited/sessions/85252963-7d14-41b9-9aac-90c8333d9e94 Co-authored-by: Nidrax <4753308+Nidrax@users.noreply.github.com>
|
@copilot Unfortunately when running the artifact, the exe triggers a system error dialog informing that the application can't continue, because it couldn't find '*.dll' object |
Agent-Logs-Url: https://github.com/veritaware/Besprited/sessions/56028f78-cafd-42e0-adb8-2bd5162f861b Co-authored-by: Nidrax <4753308+Nidrax@users.noreply.github.com>
Fixed in e65a3bd. The root cause: The packaging scripts ( |
Adds
SetDllDirectoryAsupport so that runtime-loaded DLLs (e.g.wintab32.dllfor Wacom pen support) are looked up from alib/subdirectory next to the executable. Import-linked DLLs (SDL2, freetype, etc.) remain alongside the executable, as the Windows PE loader resolves those before any application code runs and cannot be redirected viaSetDllDirectoryA.Changes
src/main/main.cpp— CallsSetDllDirectoryAat startup with the absolute path to<exe_dir>/lib, so explicitLoadLibrarycalls resolve fromlib/rather than the exe's directory:package_win.jsandpackage_win.sh— Import-linked dependency DLLs are copied alongside the executable (not intolib/), since the Windows PE loader requires them to be there at process startup..github/workflows/cmakeWin64.yml— Changed artifact upload path frombuild/bin/*(shallow glob) tobuild/bin/so any subdirectory contents are included in the Windows release artifact.