Any examples of using mclRunMain with argc and argv populated
6 次查看(过去 30 天)
显示 更早的评论
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; }
0 个评论
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 C Shared Library Integration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!