Reputation: 450
In my game engine I am dynamically loading a shared library using:
pModule = LoadLibraryW(modulePath.wstring().c_str());
when I detect file changes to the libraries source, I first unload the library using
FreeLibrary((HMODULE)pModule);
SetDllDirectory(NULL);
and then trigger a recompile. However this is where it errors with:
LINK : fatal error LNK1168: cannot open [...]\Projects\EditorGame\build\module.dll for writing
If I run the program without debugging and then trigger a rebuild, the program compiles and links successfully. This suggests that CLion is keeping reference to module.dll
in its debugger.
Is there anyway to force CLion to unload the .dll?
Upvotes: 0
Views: 22