|
我初学linux编程,在编译多个源代码文件时,遇到了一个问题,请各位指教。
源代码如下:
[php]
(1)howdy.c
#include<stdio.h>
#include"helper.h"
int main(void)
{
printf("Hello, Linux programming world!\n");
msg();
return 0;
}
(2)helper.c
#include<stdio.h>
void msg(void)
{
printf("This message sent from GuoRui.\n");
}
(3)helper.h
void msg(void)
[/php]
命令如下:
gcc howdy.c helper.c -o howdy
错误提示如下:
howdy.c: In function `msg':
howdy.c:5: parse error before '{' token
howdy.c:5: declaration for parameter `main' but no such parameter
howdy.c:7: number of arguments doesn't match prototype
cc1: prototype declaration |
|