When calling external C library (DLL) from matlab, it seems that matlab will first try to generate a thunk file named as filename_thunk_pcwinXX.dll
(where XX is either 32 or 64 depend on the OS) in a temp directory.
In matlab docs, it mentions that this file is an interface between external DLL and Matlab, so it doesnt not contain any other data of the original external DLL.
The problem is, i have written a library that at runtime may call other libraries, matlab will always give me some wierd results or even crash when the library is calling certain libraries (not all, and my library and other libraries here are 64-bit DLL).
And all my library functions work flawlessly when being called from other C/C++ programs instead of matlab.
I just wonder, in order to let matlab works properly, does these other libraries being called by my library at runtime need to get some sort of thunk file as well? I just cannot believe that, but I dont know the exact method of how matlab handle external libraries either.