在linux下用gcc,在link过程中为什么会找不到函数?
my.c中有 fun()的实现
my.h中是fun()的声明
my.c中 #include "my.h"
main.c中
#include "my.h"
且三个文件在同一个目录下
按理说应该正常link到my.c中的fun()
可为什么不行呢?出现了:
/tmp/ccdZo721.o(.text+0x19): In function `main':
: undefined reference to `fun'
collect2: ld returned 1 exit status
怎么解决呢?谢谢