0

I wanted to try to write a C++ program in "Monodevelop" and i use Ubuntu 12.10 as a OS. But when i finish writing my program (any program) and want to actually run my program, i get this error:

bash: /home/Username/C++: No such file or directory

Press any key to continue...

That "C++" in "/home/Username/C++" is supposed to be the name of the folder which i wanted to build my project in it and it's name is "c++ projects" now i understand it is because of the space that is between "c++" and "projects", so my question is, is there a way that i can build and run my program in a directory that has a space inside it's name? Now i tried writing the same program in "Code::blocks" and have had no problem. I understand i will have the same "no such file or directory" error if i try to go to a directory that has a space in it's name in the terminal, and it is pretty annoying that i can't have my program ran in the directory that i want it to run. Some help would be appreciated.

1

You need to quote your path

e.g.

"/home/Username/C++ Projects/MyAwesomeProgram/bin/myawesomeprogram"

or escape the space

/home/Username/C++\ Projects/MyAwesomeProgram/bin/myawesomeprogram
  • This works generally speaking except for with Monodevelop it just does not work (for me at least) unless I open the file from using the Monodevelop GUI. opening paths without spaces works as expected. Here is a thread start on that unix.stackexchange.com/questions/410953/… – CrandellWS May 31 '18 at 9:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.