Error "undefined function" when running my C++ with MATLAB function (C++ Matrix Library API)
1 view (last 30 days)
Show older comments
I have some MATLAB functions I developed and I would like to use then on a C++ application. My function is called "normalize.m". I compiled my function using "Application Compiler". The compiler produced some files including normalize.dll, normalize.lib and normalize.h. My MATLAB "normalize.m" function is below:
function [ Y ] = normalize( X )
Y = X/max(abs(X));
end
The C++ prototype function is below:
extern LIB_normalize_CPP_API void MW_CALL_CONV normalize(int nargout, mwArray& Y, const mwArray& X);
In my C++ code, the first function I calls "mclmcrInitialize()" followed by function "normalizeInitialize()". But the function "normalizeInitialize()" generates the following error:
undefined function 'message' for input arguments of type 'char'.
Here is the piece of code I'm using: .... mclmcrInitialize(); mwArray mwa(n, 1, mxDOUBLE_CLASS, mxREAL); mwArray ret; mwa.SetData(buffer, n); normalizeInitialize(); normalize(1, ret, mwa); normalizeTerminate(); ret.GetData(buffer, n); ....
What could be generating the error message?
PS.: I'm compiling my C++ code and producing a .dll, used as a plugin for a external application. When I compile my c++ code as a standalone application (executable) it works correctly. I"m also placing "normalize.dll" on the same directory of application/executable and the others dlls from MATLAB is on the PATH enviroment variable. I'm using MATLAB 2015a (32 bits).
Thank you.
0 Comments
Answers (0)
See Also
Categories
Find more on Deploy to C++ Applications Using mwArray API (C++03) in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!