I am facing a strange problem with building a client program with mex. In short: compilation runs fine, but at execution I get an exception "The specified module could not be found".
I am running Matlab 2019b on Win7.
I configure mex for c++ :
Strangely enough, it does not give me the choice of the compiler and takes 'Microsoft Visual C++ 2017' (Professional, licence valid). I have also mingw64 installed, but for a test it's fine.
Then I copy-paste the code into a file main.cpp, and build it:
mex -client engine main.cpp
A file main.exe is created, and on command line is output:
Building with 'Microsoft Visual C++ 2017'.
MEX completed successfully.
All seems fine.
Now, I copy-paste the dlls libMatlabDataArray.dll and libMatlabEngine.dll in the same folder, and when I run the program, I don't get the normal output, there is the exception "The specified module could not be found".
I think that I miss something but I cannot figure out what is my mistake.