The first idea is to check whether PATH and LIB env. variables refer to the correct path where Intel64 DLLs reside or not. Because in another case the program will crash exactly at the very first call to an MKL function located in any dynamic lib.
The machine my application crashes on isn't the one, on which I develop. So the LIB and PATH env. variables shouldn't have any influence - shouldn't they? (LIB actually doesn't exist at all and PATH is set to c:\windows\system32 as its first entry)
Anyway there is only one x64 version of mkl_rt.dll inside c:\windows\system32, which is definitively used by my app (if I rename the dll temporarily, my app doesn't start any longer).
So the reason for the crash should lay somewhere else...
A couple of clarifying questions: 1. Do you have the rest of required MKL dlls (e.g. libimalloc.dll mkl_mc3.dll mkl_core.dll mkl_intel_thread.dll) somewhere in the PATH? 2. Do you compile your code with -DMKL_ILP64?
You gave me the right hint. It were the above mentioned (and missing) 4 DLLs which produced the crash. So the issue is resolved for me - thanks!
But a recommendation / request:
I've used the Dependency Walker to obtain all the DLLs requested for using the MKL and it showed the mkl_rt.dll only. Why don't you load the other DLLs just the way mkl_rt.dll does. This would prevent any applications from starting if they are missing and produce an error message instead of a crash. Besides all of them would be listed in a tool like Dependency Walker.
And it would be a good idea to give an overview in the documentation, which of the DLLs of the redist directory are needed under which circumstances.