一个头文件test.h
#ifndef TEST_H
#define TEST_H
void show(void);
#endif
一个show函数的实现show.c
#include "test.h"
void show(void)
{
printf("showing\n");
}
一个主函数main.c
#include
#include "test.h"
int main(void)
{
show();
return 0;
}
这三个文件存放在ubuntu的同一个目录下,执行 gcc -o main main.c,
有错误,main.c:(.text+0x19): undefined reference to `show'。
有点纳闷,该怎么破解,求指导!