开发者

gdb "run" with error "...Cannot execute: No such file or directory"

开发者 https://www.devze.com 2023-03-26 02:43 出处:网络
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

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

精彩评论

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