Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1691132
  • 博文数量: 206
  • 博客积分: 1450
  • 博客等级: 上尉
  • 技术积分: 2285
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-11 11:38
个人简介

学习永无止境!!

文章分类

全部博文(206)

文章存档

2022年(5)

2019年(3)

2018年(8)

2017年(32)

2016年(7)

2015年(13)

2014年(44)

2013年(24)

2011年(6)

2010年(17)

2009年(46)

2008年(1)

分类: LINUX

2009-02-04 17:31:17

test.c文件内容:
#include
  2 int main()
  3 {
  4         printf("Hello world\n");
  5         return 0;
  6 }

应用: [xl.xue@localhost test]$ arm-linux-gcc -nostartfiles -nostdlib -static -L/usr/local/arm/2.95.3/arm-linux/lib -lc -lgcc test.c
报错误信息:
test.c:1:20: error: stdio.h : No such file or directory
test.c: In function 'main':
test.c:4: warning: incompatible implicit declaration of built-in function 'printf'

应用: [xl.xue@localhost test]$ arm-linux-gcc -nostartfiles -nostdlib -static -L/usr/local/arm/2.95.3/arm-linux/lib test.c -lc -lgcc
可以正确通过.
主要原因是: 当编译连接test.c时,遇到printf没有定义时,停止编译连接,查找后面的编译连接,可是否存在定义。所以上面的那种方式查不到printf定义报错。
阅读(3485) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2009-03-17 07:10:14

加上: -I/usr/local/arm/2.95.3/arm-linux/include 就可以找的stdio.h了