Hi, I think I may have found something potentially helpful.
I had a very similar issue, and just resolved it. In case it's relevant, I was using Intel's Fortran compiler in a Visual Studio project to build a fortran file. The built EXE was trying to load some dll that it couldn't do from within MATLAB, but within native windows cmd window, or double-click it could do it.
- You need to change the runtime library setting for your project within Visual Studio - the default within Visual Studio is to produce an executable that requires the Fortran runtime libraries.
- Change to a Release configuration, then rIght click on your project in the solution explorer, select Properties, then in the Configuration Properties > Fortran > Libraries page change the Runtime Library option to "Multithreaded". Rebuild your project.
- (If you use OpenMP within your project, then you will still have a dependency on some of the OpenMP DLL's.)
I sort of backed into this when I tried to run my compiled .exe on another PC that didn't have the same build environment setup, and it barfed on me indicating "libmmdd.dll" was not found. Additionally, I tried system('cmd &') to have Matlab open up a command window..and I found that one compiled version (i.e. via G77) worked, and the one I used Visual Studio for didn't work! (i.e. emulating FORTRAN IV/66 semantics (Sheesh, don't ask!)) .
From there I guess that it couldn't load that library in the MATLAB "system" scaffolding. I am not sure.
Regardless, for me the key was changing the "Runtime Library" option to "Multithreaded", from "Multithreaded dll". As soon as I could do it, the exe was runnable.
Hope this helps someone! :)