how to use custom c library in stateflow?

3 ビュー (過去 30 日間)
Matteo
Matteo 2023 年 9 月 25 日
回答済み: Gowtham 2023 年 10 月 9 日
I try to access the function in a custom c library but I obtain the error:
"the following functions are undefined in specified custom code source files or library files"
It seems that stateflow sees the header where the function is declered but not the .dll.
in configuration parameters I link the path where the library .lib is and I put the .dll in the same folder of the stateflow model.
What can I do?

回答 (1 件)

Gowtham
Gowtham 2023 年 10 月 9 日
Hello Matteo,
I understand you are facing an issue while attempting to access a function in a custom C library from Stateflow, resulting in an error stating that the function is undefined.
To address the issue, I recommend following these steps:
  1. Open the Configuration Parameters of your project.
  2. Navigate to the Simulation Target section.
  3. In the Code Information tab, ensure that you have included the necessary header files by adding them to the 'Include headers' field.
  4. Verify that you have correctly specified the folder paths containing the custom header, source, and library files in the 'Include directories' field.
  5. Double-check that you have listed all the required source files in the 'Source files' field.
  6. Make sure you have accurately entered the names of the necessary libraries in the 'Libraries' field.
Kindly refer to the following MATLAB documentation for further information on how to use custom C library in Stateflow https://www.mathworks.com/help/stateflow/ug/share-data-using-custom-c-code.html
Hope this helps.
Best Regards,
Gowtham

カテゴリ

Help Center および File ExchangeComplex Logic についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by