Any examples of using mclRunMain with argc and argv populated

1 回表示 (過去 30 日間)
Tony Kirke
Tony Kirke 2017 年 2 月 8 日
回答済み: Sanket Karnik 2017 年 2 月 15 日
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; }

採用された回答

Sanket Karnik
Sanket Karnik 2017 年 2 月 15 日
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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeC Shared Library Integration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by