Cannot find MEX function when executing C
Mostrar comentarios más antiguos
System
- Ubuntu running R2010a
Error
- Undefined function or method 'mex' for input arguments of type 'char'.
Compilation call
/usr/local/matlab/bin/mcc -m -v -R -nodisplay remote_estimation.m
Context
- Compiling .m file that has the follwing code:
function remote_estimation()
%#function mex
mex('/path/to/file.c');
When executing in matlab it works, after compiling and executing the binary, it gives the error described above
Respuesta aceptada
Más respuestas (1)
Kaustubha Govind
el 1 de Feb. de 2012
0 votos
It is likely that the "mex" command is not supported for deployment. Is there a reason that you can't simply include your MEX-file with your application's CTF archive (using the mcc -a option)? Since the compiled application is platform-specific, the MEX-file from your machine should be sufficient on all target machines.
2 comentarios
André
el 1 de Feb. de 2012
Walter Roberson
el 1 de Feb. de 2012
Does the generated mex code call the MATLAB routines, or is it pure C and OS calls? If it is pure C and OS calls, then can the toolbox emit C without the the mex headings, in a form that you could call upon a C compiler and generate a dynamic library that you could loadlibrary() on ?
Categorías
Más información sobre Write C Functions Callable from MATLAB (MEX Files) en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!