linux make 出现错误。我有建立文件夹,但是显示没有那个文件还有没有规则,请有经验者指点。 linux下运行make和make install有错误提示...

linux\u7cfb\u7edf\u4e0b\u7f16\u8bd1\u51fa\u73b0\u6ca1\u6709\u89c4\u5219\u53ef\u4ee5\u521b\u5efa\u662f\u600e\u4e48\u56de\u4e8b\uff1f

make menuconfig \u65f6\u9009\u62e9GSL1680\u89e6\u6478\u5c4f\u8bbe\u5907\u4e86\u5417\uff1f

\u4f60\u5148\u6267\u884c\u914d\u7f6e\u5b89\u88c5\u5305\u547d\u4ee4\u6ca1\u6709\uff1a
[root@localhost ~]# ./configure
\u5982\u679c\u5df2\u6267\u884c\u770b\u770b\u6267\u884c\u7ed3\u679c\u6709\u6ca1\u6709\u9519\u8beferror\u7684\u63d0\u793a\uff0c\u4e00\u822c\u662f\u53ef\u80fd\u7f3a\u5c11\u4ec0\u4e48\u4f9d\u8d56\u5305\uff0c\u5982\u679c\u6ca1\u6709\u9519\u8bef\u63d0\u793a\uff0c\u5c31\u662f\u4f60\u7684\u539f\u7801\u5305\u6709\u95ee\u9898\uff0c\u91cd\u65b0\u4e0b\u8f7d\u4e00\u4e2a\u5427\uff01

你代码也没有,调用堆栈也没有,谁能知道为啥段错误啊,要不然你猜我今天穿什么颜色的衣服?
大神也不敢说自己害缉愤垦莅旧缝驯俯沫的代码肯定就没有错误,我猜你的意思是能正确编译吧?
那只能说明你的语法没错,仅此而已,写程序能正确编译只是第一步,后面调试的工作还很漫长。
下面说说怎么调试吧:
看你的系统提示应该还没有打开core输出,在运行程序前打个命令:
ulimit -c unlimited
这样设置之后再运行程序在段错误的时候能core dump,有core之后再gdb ./test core.xxx
core文件一般在你运行程序的目录里,core文件后缀每次不同,后面的xxx你需要自己看看文件名,一般是运行时的PID号。当然如果你的系统core的生成规则被改过,不是默认的,那就问你的系统管理员去找到core文件。
进去后打个bt,看下当前的调用堆栈,然后再看下哪儿出的问题。
当然这样做有个前提,那就是你在编译你的程序时加了-g参数,如果没有,重新去编译下再运行。
如果还是找不出来,再把你的调用堆栈和代码发上来大家看看。
控制面板错误提示

[yinlei@localhost shiyan2]$ gcc -l /usr/src/kernels/2.6.32-鼎川尺沸侔度踌砂穿棘431.11.2.el6.i686/include/linux module.c -o main.exe
module.c:2:24: 错误:linux/init.h:没有那个文件或目录
module.c:3:26: 错误:linux/module.h:没有那个文件或目录
module.c:4: 错误:expected declaration specifiers or ‘...’ before string constant
module.c:4: 警告:数据定义时没有类型或存储类
module.c:6: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘hello_init’
module.c:12: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘hello_exit’
module.c:17: 警告:数据定义时没有类型或存储类
module.c:17: 警告:函数声明中出现形参名却未指定类型
module.c:18: 警告:数据定义时没有类型或存储类
module.c:18: 警告:函数声明中出现形参名却未指定类型
[yinlei@localhost shiyan2]$

程序代码如下:

#include<linux/kernel.h>
#include<linux/init.h>
#include<linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");

static int __init hello_init(void)
{
printk("Hello world/n");
return 0;
}

static void __exit hello_exit(void)
{
printk("Bye Corne/n");

}
module_init(hello_init);
module_exit(hello_exit);
~

扩展阅读:linux make install ... linux make命令详解 ... java windowbuilder ... linux make用法 ... linux make出现no rule ... linux make命令不存在 ... linux make 编译安装 ... linux grep c ... linux sed命令 替换 ...

本站交流只代表网友个人观点,与本站立场无关
欢迎反馈与建议,请联系电邮
2024© 车视网