Chinaunix

标题: arm-linux-gcc 编译hello.c发生错误 提示:hello.c:1:21:stdio.h没有文件或目录 [打印本页]

作者: Geraldg    时间: 2013-08-03 22:59
标题: arm-linux-gcc 编译hello.c发生错误 提示:hello.c:1:21:stdio.h没有文件或目录
本帖最后由 Geraldg 于 2013-08-04 09:45 编辑

arm-linux-gcc 编译hello.c发生错误 提示:hello.c:1:21:stdio.h没有文件或目录





求大神解决这个问题
[attach]645785[/attach]

捕获.PNG (37.39 KB, 下载次数: 27)

捕获.PNG

作者: Geraldg    时间: 2013-08-03 23:00
[attach]645786[/attach]回复 1# Geraldg


   
作者: 青天难下    时间: 2013-08-20 15:52
arm-linux-gcc 与 gcc 是两回事
stdio.h 是标C的头文件 你编译 用GCC
arm-linux-gcc是交叉编译 当然没有stdio.h
作者: 青天难下    时间: 2013-08-20 16:01
arm-linux-gcc 可编译的 hello.c:

#include <linux/init.h>
#include <linux/module.h>

static int __init helloworld_init(void)
{
        printk(KERN_ALERT "My first helloworld kernel moudle!\n");
       
        return 0;
}

static void __exit helloworld_exit(void)
{
        printk("byebye!\n");
}

module_init(helloworld_init);
module_exit(helloworld_exit);






欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2