gcc warning: function used but not defined

后端 未结 3 1897
鱼传尺愫
鱼传尺愫 2021-02-04 03:13

I am getting the warning: function used but not defined. I have static __inline__ in header file say a.h. The header file is included in <

3条回答
  •  再見小時候
    2021-02-04 04:00

    You've declared the function to be static. This means that it is only visible within the current compilation unit. In other words: the implementation is only visible inside the a.c file. You need to remove the static keyword both in the a.h and a.c so that other .c files can see the function. You should specify a return value, e.g. void function1(); because it implicitly is int if you didn't specify one.

提交回复
热议问题