MATLAB / C# integration error - Unable to find entry point in DLL

7 views (last 30 days)
Hi,
We are developing an integration involving a C# DLL calling a MATLAB generated DLL (libMSPC_C64.dll). MATLAB dll exposes 2 methods: CreaModelo and GeneraAlertas. When running a C# test program we get the following error for first method: "Unable to find an entry point named 'CreaModelo' in DLL 'libMSPC_C64.dll'". But if within C# we declare and call mlxCreaModelo instead, it is recognized, and method can be called without errors. Same happens with GeneraAlertas method. Why that may be happening?
Is important to say that machine running C# project only has MATLAB compiler runtime installed (MCR R2013b win64). C# project references MATLAB dll (libMSPC_C64.dll) and also references MWArray.dll (MATLAB dll for array types).
C# code extract (simplified):
using System.Runtime.InteropServices; using MathWorks.MATLAB.NET.Utility; using MathWorks.MATLAB.NET.Arrays;
[DllImport(DllFilePath, CallingConvention = CallingConvention.ThisCall)]
private extern static void CreaModelo(int nargout, MWArray error, MWArray alertas,
MWArray top_var, MWArray coeficientes, MWArray medias, MWArray varianzas,
MWArray latentes, MWArray scores, MWArray limite_spe, MWArray observaciones,
MWArray nivel_conf, MWArray umbral, MWArray num_top);
[DllImport(DllFilePath, CallingConvention = CallingConvention.ThisCall)]
private extern static int GeneraAlertas(int nargout, MWArray error, MWArray alertas,
MWArray top_var, MWArray observaciones, MWArray nivel_conf, MWArray umbral,
MWArray num_top, MWArray coeficientes, MWArray medias, MWArray varianzas,
MWArray latentes, MWArray scores, MWArray limite_spe);
<...code here...> try { if (MathWorks.MATLAB.NET.Utility.MWMCR.IsMCRInitialized()) { <... initializations here...> CreaModelo(9, error, alertas, top_var, coeficientes, medias, varianzas, latentes, scores, limite_spe, observaciones, nivel_conf, umbral, num_top); } } catch(Exception e) { handling here... }
MATLAB DLL was first generated as a C++ shared library and later as a C shared library but we receive the same error in both cases.
I attached header file for MATLAB DLL for reference purposes (libMSPC_Cpp64h)
Many thanks in advance!

Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!