mwArray crashing in c++ code

hi,
i have complied a matlab function to c++ function using mcc.
the resulting c++ function needs mwArray's as input.
in my c++ code when i specify
mwArray output_results(1,1,mxDOUBLE_CLASS);
the code crashes. Anywhere I try to define a mwArray the code crashes.
What should i do to resolve this.
thanks in advance

 Respuesta aceptada

Kaustubha Govind
Kaustubha Govind el 16 de Oct. de 2012

0 votos

You probably are missing a call to mclInitializeApplication. Please follow the example from the documentation to ensure that you perform all the required steps.

Más respuestas (1)

Bruno
Bruno el 14 de Nov. de 2012

0 votos

Had the same problem. Anywhere I declare a mwArray objet it crashes. Even after mclInitilizeApplication.
I'd like some comments on the issue.

4 comentarios

Kaustubha Govind
Kaustubha Govind el 14 de Nov. de 2012
Do you also have the following lines after the call to mclInitializeApplication:
if (!libmatrixInitialize()){
fprintf(stderr,"could not initialize the library
properly\n");
return -1;
}
Bruno
Bruno el 15 de Nov. de 2012
Editada: Bruno el 15 de Nov. de 2012
Yes I do.
here is my code :
mclmcrInitialize();
if (mclInitializeApplication(NULL, 0))
{
if (MyLibInitialize())
{
mwArray plugin; <=== crash
...
}
}
Kaustubha Govind
Kaustubha Govind el 15 de Nov. de 2012
Hmm.. I haven't used MATLAB Compiler in a while, so I might be missing something. Could you perhaps try the example in the documentation and see if that works? If it does, perhaps you should try to emulate the example more closely to see if that works better.
Joshua Baldwin
Joshua Baldwin el 26 de Sept. de 2017
The documentation that you linked is no longer available on the Mathworks site.

Iniciar sesión para comentar.

Categorías

Productos

Etiquetas

Preguntada:

el 16 de Oct. de 2012

Comentada:

el 26 de Sept. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by