MATLAB: Where are the compiled THUNK files located and how to re-use them

dllloadlibraryMATLAB Compilerthunkthunkfilelocations

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

Best Answer

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.