Unload C++ shared library interface DLL

7 ビュー (過去 30 日間)
jh
jh 2021 年 9 月 21 日
回答済み: 埃博拉酱 2024 年 10 月 28 日 14:51
When developing and testing a c++ shared library interface, rebuilding it with build() it fails with permission denied because the DLL file already exists, but if you try to delete it it gives an error that it can't be deleted because it's open in matlab (from the previous testing). Is there a way to unload it?
unloadlibrary does not work for this, it says "Could not find library class to unload it" (libisloaded also returns 0)
I found this question asked at least twice before but with no answer in either case.
Any info appreciated, even if it's a confirmation that it's not possible.

回答 (1 件)

埃博拉酱
埃博拉酱 2024 年 10 月 28 日 14:51
I think you're probably going to need to use the Windows NT API. It is true that there is no way to uninstall the clib in the official MATLAB documentation.
Another way is to write a C++ MEX file function that can be easily unloaded using clear mex.

カテゴリ

Help Center および File ExchangeCall C++ from MATLAB についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by