We create DLL's ( called MEX files) for Matlab. One of the big issues we have is trying to avoid DLL-hell issues when our DLLs are loaded into Matlab ( they just load the DLL/Mex file using LoadLibrary). We managed to get this all working for most Matlab versions
Up until Matlab 2009b, Matlab binaries has been compiled with older Intel compilers and linked against libguide40.dll, so we have had to follow suit. However, the 2009b version of Matlab has switched to libiomp5.dll and so now all our MEX files (linked against libguide40) throw an acess violation inside libguide40 in kmp_set_default when they load.
Setting KMP_DUPLICATE_LIB_OK=TRUE does not help
This shows that
If libiomp5.DLL is loaded, then a Mex DLL cannot depend on libguide40.dll
My question is if ...
libguide40.DLL is already loaded, can a DLL load libiomp5.DLL without an access violation?
The motivation is that if we switch to building with "compatibility" libiomp5 lib, to get compatibility with Matlab >2009b, will this break compatibility with Matlabs <2009b