Effacer les filtres
Effacer les filtres

Any examples of using mclRunMain with argc and argv populated

2 vues (au cours des 30 derniers jours)
Tony Kirke
Tony Kirke le 8 Fév 2017
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; }

Réponse acceptée

Sanket Karnik
Sanket Karnik le 15 Fév 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

Plus de réponses (0)

Catégories

En savoir plus sur C Shared Library Integration dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by