0

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++/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.

1
  • It doesn't look like you're running the correct program… The first line from gdb should be Starting program: …/test… Are you sure you're running exactly the commands you've shown here? Commented Aug 6, 2011 at 6:25

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

My point is try running it from a different location which wouldn't have C\C++ in the path.
Thanks! It works like a charm now. So, this thread is closed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.