简体   繁体   English

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

[英]gdb “run” with error “…Cannot execute: No such file or directory”

I am Ubuntu 10.04 user and I wrote a very simple program, which I compiled with gcc : 我是Ubuntu 10.04用户,我编写了一个非常简单的程序,并使用gcc

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

Then I loaded it with gdb: 然后我用gdb加载了它:

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

Then I ran it: 然后我运行它:

(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)

Could anybody tell me why is this happening? 谁能告诉我为什么会这样吗? Thanks in advance. 提前致谢。

Try checking your path: 尝试检查您的路径:

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

it has C\\C++ in it whereas gdb says: 它具有C\\C++ ,而gdb表示:

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

C\\C++ is made into CC++ . C\\C++制成CC++ I would guess that's why it can't find the file. 我猜这就是为什么找不到文件的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM