Deploying a standalone application that uses a shared library

Hello,
I am trying to create a standalone Matlab application that uses a Simulink model. For this purpose, I compiled the Simulink model into a .dll file using this french tutorial. This worked pretty well and in Matlab I can use all the functions of the model.
The next step would be to compile the entire Matlab programm into a standalone application. Simply using the application compiler doesn't work and I read that the function loadlibrary is not supported in standalone applications. The GUI works, but when I try to calculate something with the model, nothing happens.
What would the correct way of doing this be? I read something about maybe 'prototype files'.
Thanks in advance!

댓글 수: 2

coder.ceval() inside a MATLAB Function Block can be used to add a call to an arbitrary C function, passing in parameters. After that it is just a matter of linking the library to the executable at build time.
Thanks for the response! How exactly would I go about doing this? I am currently loading in the library with a header .m file. By linking the library to the exe, do you mean including the files in the build?

댓글을 달려면 로그인하십시오.

 채택된 답변

ZedRedLed
ZedRedLed 2018년 12월 21일

0 개 추천

Nevermind, I ended up following these instructions. I was confused at first, because the loadlibrary function with the mfilename addition wasn't creating any new prototype file, but I ended up just using the old .m header, only this time I also included the newly generated thunk .dll as a required file. After that, everything worked as expected and I did not have to change anything inside my actual code.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Simulink Coder에 대해 자세히 알아보기

질문:

2018년 12월 20일

답변:

2018년 12월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by