What do I need to include when I use a static C library from Coder?

3 次查看(过去 30 天)
I'm trying to learn how to use Coder. I have a simple Matlab function that I have converted into a static C library. I want to use this library on another machine as part of a larger program. What exactly do I need to move? Do I need the whole folder, including the examples and interface sub-folders?
This second machine will know nothing about Matlab, it runs only C.
What do the _initialize and _terminate functions do? Are they needed in a C environment?

采纳的回答

Ryan Livingston
Ryan Livingston 2015-8-1
编辑:Ryan Livingston 2015-8-1
The MATLAB Coder documentation has a deployment section with many relevant topics that discuss this. Some particular pages of note would be:
  • Calling the generated functions - Describes the interface for the code and the initialize and terminate functions. Those functions set up some necessary data structures and any persistent or global data. Call initialize once before using your other generated code and call terminate once at the end.
  • Package generated code - Describes how to package the code and any necessary dependencies to move to another environment.
  • Using and example main - The examples folder contains an example of a C main function that can call your generated code. It shows how to interact with the generated code and can be a good starting place for using the code. The example main also shows the proper usage the initialize and terminate functions.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Coder 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by