Azzera filtri
Azzera filtri

Any examples of using mclRunMain with argc and argv populated

2 visualizzazioni (ultimi 30 giorni)
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; }

Risposta accettata

Sanket Karnik
Sanket Karnik il 15 Feb 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

Più risposte (0)

Categorie

Scopri di più su C Shared Library Integration in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by