필터 지우기
필터 지우기

What does "function ?? declared implicitly" means?

조회 수: 12 (최근 30일)
lim daehee
lim daehee 2023년 9월 11일
댓글: lim daehee 2023년 9월 12일
Hi, I'm trying to integrate my c code to simulink.
I made a header file and a source file named file.h and file.c.
and there is a function named function1 and the code is stated below.
function1(void)
{
static double a;
a = a+1;
return a;
}
Next, I made a C caller block and typed like below.
function1();
After that, I ran my code and the error is stated like this.
In line 1:error: 223, function "function1" declared implicitly
| function1();
| ^
How can I solve this error?

답변 (1개)

Bruno Luong
Bruno Luong 2023년 9월 11일
편집: Bruno Luong 2023년 9월 11일
you need add double as return type for your function prototype and declaration
double function1(void);
double function1(void)
{
...
}
  댓글 수: 2
lim daehee
lim daehee 2023년 9월 12일
Oh, sorry, I forgot that in my question..
My code contains return type like below.
in header file
double function1();
in source file
double function1()
{
static double a = 0;
a = a+1;
return a;
}
lim daehee
lim daehee 2023년 9월 12일
Dear Bruno Luong,
I finally found my problem.
I forgot including my c files in my simulation target..
Thanks for your help:)

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

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by