gdb“运行”,错误“...无法执行:没有这样的文件或目录”

时间:2011-08-06 06:17:25

标签: linux ubuntu gdb

我是Ubuntu 10.04用户,我写了一个非常简单的程序,我用gcc编译:

xyz@xyz-desktop:~/xyz/projects/C\C++/epollsvr/src$ gcc -g -o test test.c

然后我用gdb加载它:

xyz@xyz-desktop:~/xyz/projects/C\C++/epollsvr/src$ gdb test

然后我跑了它:

(gdb) run

Starting program: /home/xyz/xyz/projects/C\C++/epollsvr/src/num*
/bin/bash: /home/xyz/xyz/projects/CC++/epollsvr/src/num: No such file or directory
/bin/bash: line 0: exec: /home/xyz/xyz/projects/CC++/epollsvr/src/num: cannot execute: No 
such file or directory

During startup program exited with code 126.
(gdb)

有人能告诉我为什么会这样吗?提前谢谢。

1 个答案:

答案 0 :(得分:3)

尝试检查您的路径:

Starting program: /home/xyz/xyz/projects/C\C++/epollsvr/src/num*

它有C\C++,而gdb说:

/bin/bash: /home/xyz/xyz/projects/CC++/epollsvr/src/num: No such file or directory

C\C++已成为CC++。我猜这就是它无法找到文件的原因。