User forums > Using Code::Blocks
Issue running after build
progr@mm1nG3niu5:
sorry, didn't mean to offend you with the caps lock...i wasn't implying anything with it. anyway, it seems that you think i'm being disrespectful, and if you actually did read my post, i thanked you multiple times a ton for your initial response...i never once repeated myself or repeated anything I said in my initial post. i responded with your suggested changes, and then simply pasted the errors i saw after the changes. not sure why you would even think i was being rude.
in all, i'm just someone trying to learn, not create drama or an uncomfortable situation.
thanks anyway!
pirx67:
--- Quote from: progr@mm1nG3niu5 on January 17, 2011, 08:44:28 pm ---WHEN I MADE THE CHANGE YOU SUGGESTED, WHICH IS TO TURN ON THE FULL COMMAND LINE, I AM GETTING THE FOLLOWING MESSAGE WHEN I BUILD:
Adrian-Hoggs-MacBook:~ adrianhogg$ /Users/adrianhogg/Documents/C++ALL-IN-ONE-DUMMY/first_project-hello/Hello /bin/Debug/Hello
-bash: /Users/adrianhogg/Documents/C++ALL-IN-ONE-DUMMY/first_project-hello/Hello: No such file or directory
Adrian-Hoggs-MacBook:~ adrianhogg$
--- End quote ---
Well, I guess the following:
a) You did use "Build -> Build and Run" from the menu and not "Build -> Build" as you have written.
b) Your application is built correctly but running it fails. Wether the build is really fine we can't see because you missed to post the output from the "Build log" tab of Code::Blocks as requested.
c) Look at the error message:
--- Quote ----bash: /Users/adrianhogg/Documents/C++ALL-IN-ONE-DUMMY/first_project-hello/Hello: No such file or directory
--- End quote ---
The default shell interpreter of your user account ("bash") can't run the command Code::Blocks told it to do so. What command bash is looking for? It tells you:
--- Quote ---/Users/adrianhogg/Documents/C++ALL-IN-ONE-DUMMY/first_project-hello/Hello
--- End quote ---
Why does this happen? oBFusCATed gave a hint about it in his last post (in the quote in red).
A short explanation on the probable cause. Code::Blocks builds the output binary (debug build) in a directory ./bin/Debug relative to the base directory of your project. After building it runs the new program with the full path to it. The program's name is made of "[base directory of project]/bin/Debug/[projects name]".
The full name with path of your new seems to be:
--- Quote ---/Users/adrianhogg/Documents/C++ALL-IN-ONE-DUMMY/first_project-hello/Hello /bin/Debug/Hello
--- End quote ---
This whole string is passed to bash to execute the program. What does bash with it? It splits the at the blank as all shell interpreters do (if you don't quote ...) and gets a program name
--- Quote ---/Users/adrianhogg/Documents/C++ALL-IN-ONE-DUMMY/first_project-hello/Hello
--- End quote ---
with a parameter
--- Quote ---/bin/Debug/Hello
--- End quote ---
That is not what you neither Code::Blocks wanted. Now you know why blanks in pathes and file names are evil. Because it needs extra care to make the things work.
In your case it seems that your projects base directory name contains still a blank ("Hello "). Perhaps you created your project's name "Hello " with a blank in it?
Try to make a new console project with the project wizard in a base directory without any blanks in it and with no blanks in the project's name. This should work then.
For some hints how bash evaluates a command line refer to "man bash" in a terminal window.
Hope that leads you into the right direction,
pirx67
thomas:
--- Quote from: oBFusCATed on January 17, 2011, 10:38:54 pm ---Do you have a problem with the CAPSLOCK key or you're intentionally using capitals?
--- End quote ---
Might be a lawyer. :)
Navigation
[0] Message Index
[*] Previous page
Go to full version