Use a compiled Library .a extension in simulink

Hello,
I have a compiled library file .a extension, I need to import this file into simulink and use it in my simulation activities. How can I use this file in simulink? I need to integrate it as a block in a big model?
Thank you in advance for your response.
Regards,
Ali ISSA

답변 (1개)

Mark McBroom
Mark McBroom 2024년 4월 27일

0 개 추천

You can use the C Caller block to call a function that exists in a library. You'll need the header file that defines the function prototype.

댓글 수: 3

Ali
Ali 2024년 6월 4일
Thank you for your answer.
In fact I used the C caller block and I put my library file (.a) in the additional build information --> Libraries section, but when I compile the model it's saying that simulink is not able of finding any defined functions!!
Is this normal? in which place exactly I should put the name of my library (i.e, inside custom code). Thanks in advance.
Ali
Ali
Ali 2024년 6월 4일
Is there a special syntax that should I respect in entering the library, because I have always the same error obtained "Caused by:
  • C:\Build_Lib\source_1\slprj\_slcc\7xBLFt7WXeeQZ6YiprJ5CB\customcode_7xBLFt7WXeeQZ6YiprJ5CB.c:4:2: error: expected identifier or '(' before string constant "C:\\Build_Lib\\source_1")
You can look at the C file mentioned in the error message. Since the error is happening near the top of the file ( line 4), best guess is that you entered the name of the header file incorrectly in the custom code : Include Headers diaglog. You should enter something like: #include "myHeader.h"
Thanks.
Mark.

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

카테고리

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

질문:

Ali
2024년 4월 25일

댓글:

2024년 6월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by