Borrar filtros
Borrar filtros

Any examples of using mclRunMain with argc and argv populated

2 visualizaciones (últimos 30 días)
When I do this, I get segmentation fault/Bad access errors
int main(int argc, const char* argv[]) { mclRunMain((mclMainFcnType)run_main, argc, argv); return 0; }

Respuesta aceptada

Sanket Karnik
Sanket Karnik el 15 de Feb. de 2017
I understand that you want an example of 'mclRunMain' with 'argc' and 'argv' arguments. I assume that you are trying to use MATLAB Compiler generated C++ shared library in your program. Please find attached an example where I have implemented simple string concatenation function which accept 2 strings from command line and prints concatenated string. The MATLAB function I had used to created the library is following:
function out = concatString(input1,input2)
out = strcat(input1,input2);
end
I have attached the C++ code I have used to call the library here.
Please refer the following link to see how to integrated C++ shared library in your code: https://www.mathworks.com/help/compiler_sdk/cxx/integrate-a-cc-shared-library-into-an-application.html

Más respuestas (0)

Categorías

Más información sobre C Shared Library Integration en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by