求救,ubuntu下不能执行二进制的可执行文件。
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
-
- 帖子: 6
- 注册时间: 2008-12-02 21:51
求救,ubuntu下不能执行二进制的可执行文件。
我打开GDB,调试刚刚用gcc编译的test文件,执行(gdb)run时,提示无法执行二进制文件,在shell下直接执行./test也是说无法执行二进制文件,请问这是什么问题啊?
-
- 帖子: 6
- 注册时间: 2008-12-02 21:51
Re: 求救,ubuntu下不能执行二进制的可执行文件。
以下是终端显示信息:
colinyao@colinyao-desktop:~$ arm-linux-gcc -g test.c -o test
colinyao@colinyao-desktop:~$ gdb
GNU gdb 6.6-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
(gdb) file test
Reading symbols from /home/colinyao/test...done.
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) list
1 #include <stdio.h>
2 int main()
3 {
4 int a,b,c;
5 a=9;
6 b=3;
7 c=a/b;
8 printf("The result of %d/%d is %d\n",a,b,c);
9 return 0;
10 }
(gdb) run
Starting program: /home/colinyao/test
/bin/bash: /home/colinyao/test:无法执行二进制文件
/bin/bash: /home/colinyao/test: Success
Program exited with code 01.
You can't do that without a process to debug.
(gdb)
colinyao@colinyao-desktop:~$ arm-linux-gcc -g test.c -o test
colinyao@colinyao-desktop:~$ gdb
GNU gdb 6.6-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
(gdb) file test
Reading symbols from /home/colinyao/test...done.
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) list
1 #include <stdio.h>
2 int main()
3 {
4 int a,b,c;
5 a=9;
6 b=3;
7 c=a/b;
8 printf("The result of %d/%d is %d\n",a,b,c);
9 return 0;
10 }
(gdb) run
Starting program: /home/colinyao/test
/bin/bash: /home/colinyao/test:无法执行二进制文件
/bin/bash: /home/colinyao/test: Success
Program exited with code 01.
You can't do that without a process to debug.
(gdb)
- xhy
- 帖子: 3916
- 注册时间: 2005-12-28 1:16
- 系统: Ubuntu 12.10 X64
- 来自: 火星