[嵌入式linux] 嵌入式C求救

[复制链接]
 楼主| haha1995 发表于 2015-4-12 16:05 | 显示全部楼层 |阅读模式
我在练习GCC的使用时,写了一个头文件test.h 还写了一个main.c
在编译链接时出现这个错误
test.h#include<stdio.h>



main.c
#include"test.h"
int main()
{
int a=2,b=2;
return (a+b);
}





本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
0Shadow 发表于 2015-4-12 22:15 | 显示全部楼层
#include"test.h"  -->  #include "test.h"
#include<stdio.h> --> #include <stdio.h>

 楼主| haha1995 发表于 2015-4-13 14:27 | 显示全部楼层
0Shadow 发表于 2015-4-12 22:15
#include"test.h"  -->  #include "test.h"
#include --> #include

谢谢您回我的贴。
我在test.h文件中只包含main.c所需要的头文件#include<stdio.h>,是为了练习一下gcc中带有头文件的程序的编译,可是却出现了提示的错误。
您的解答,我还是不太明白。
chybeyond 发表于 2015-4-14 22:04 | 显示全部楼层
中间要加一个空格
mini1986 发表于 2015-4-17 12:00 | 显示全部楼层
这都问,好好看看书,比着书来一遍先
user5220 发表于 2015-4-19 19:06 | 显示全部楼层
是不是头文件出现了语法错误
您需要登录后才可以回帖 登录 | 注册

本版积分规则

9

主题

14

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部