|
楼主 |
发表于 2003-8-14 13:30:22
|
显示全部楼层
我把所有程序贴出来看看
(1)hello.c
#include<stdio.h>
int main(void)
{
printf("Hello, Linux programming world!\n");
return 0;
}
(2)helper.c
#include<stdio.h>
void msg(void)
{
printf("This message sent from GuoRui.\n");
}
(3)helper.h
void msg(void);
(4)howdy.c
#include<stdio.h>
#include"helper.h"
int main(void)
{
printf("Hello, Linux programming world!\n");
msg();
return 0;
}
(5)makefile
howdy: howdy.o helper.o helper.h
gcc howdy.o helper.o -o howdy
howdy.o: howdy.c
gcc -c howdy.c
helper.o: helper.c
gcc -c helper.c
hello: hello.c
gcc hello.c -o hello
all: howdy hello
小弟初学,望各位不吝赐教 |
|