About C caller usage

3 views (last 30 days)
hoang tuan
hoang tuan on 19 Mar 2020
Commented: hoang tuan on 19 Mar 2020
Hello
I'm trying to use the C-caller block to import my C-code into simulink.
now i'm trying just a simple code as below:
#include <stdio.h>
int add_fnc (int a, int b)
{
int c;
c = a +b;
return c;
}
I do as the instruction in configuration parameter to set source file.
I run the c-caller block and set the variable name is add_func.
The warning is can not find add_func.
Can you support me?
  2 Comments
hoang tuan
hoang tuan on 19 Mar 2020
Thank you.
And it seems we have to create header file to mention the function prototype first.
We can not add direct the c source code only.

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by