Where are the compiled THUNK files located and how to re-use them?
10 次查看(过去 30 天)
显示 更早的评论
Hi All;
I am having trouble locating where the 64-bit THUNK files are located on my Windows 7 laptop when using LOADLIBRARY. The documentation states the default naming convention but not where they reside on my hard-drive.
I am using the default MinGW compiler.
Also, I am interested in knowing how to compile once and then to re-use these THUNK files as the time to re-compile each time LOADLIBRARY is called seems excessive especially given that I have 7 DLL's that are needed to be loaded each time.
Kindest regards, Jeff
0 个评论
采纳的回答
Image Analyst
2016-7-28
Jeffrey, you have to create the thunk file - it doesn't ship with MATLAB, at least not a custom thunk file for your custom DLL. My attached well-commented file where I had to create one may help you.
更多回答(1 个)
Philip Borghesani
2016-7-28
If you specify the mfilename option to loadlibrary then the thunk file will be created in the same directory as the prototype file and used when the prototype file is used to load the library. By default the thunk file is placed next to the prototype file in a temporary directory created inside tempdir. It is also possible to override the thunkfilename with a second option to loadlibrary.
2 个评论
Philip Borghesani
2016-7-28
编辑:Philip Borghesani
2016-7-28
The thunk file is placed in a directory that is named with the tempname MATLAB command. The file generated into the temp directory is deleted when the library is unloaded or MATLAB exits. Specifying mfilename changes the location and prevents it from being cleaned up. If you still want to find it I suggest using process explorer from sysinternals and searching for the dll when you have it loaded into matlab.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 C Shared Library Integration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!