I want to call a static function from another C file. But it always show \"function\" used but never defined
.
In ble.c
The keyword static
is often used to encapsulate the function in the source file where it is defined. So it is not meant to call a static
function from outside, an other c-file. An extern article[^] is explaining that topic pretty good I think.
Quote:
Static functions are much like private methods in Java or C++. A private method is a method which is only used by a class and can't be used outside of it. In C, we can declare a static function. A static function is a function which can only be used within the source file it is declared in.
So as a conclusion if you need to call the function from outside you do not define the function as static
.