开发者

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:

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

Then I loaded it with 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++/ep开发者_开发技巧ollsvr/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:

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

C\C++ is made into CC++. I would guess that's why it can't find the file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜