头文件的问题
我在头文件comm.h中定义了 extern int plus_one( int *num, int min, int max);
然后在comm.c中给出了具体的实现,可是在调用的时候有问题:
如果引用comm.c(#include "comm.c")那么一切正常
如果引用comm.h,就有如下错误:
[root@localhost workspace]# gcc pro01.c -o pro012
/tmp/ccCvmjum.o(.text+0xb1): In function `main':
: undefined reference to `plus_one'
/tmp/ccCvmjum.o(.text+0xcb): In function `main':
: undefined reference to `plus_one'
/tmp/ccCvmjum.o(.text+0xe2): In function `main':
: undefined reference to `plus_one'
collect2: ld returned 1 exit status
[root@localhost workspace]#
我已经在comm.c中包含了comm.h(#include "comm.h")
是哪儿的问题呢?