Hello World not working

Hello there,
I am very new to c++, and I am having some problems running the Hello World! program on my mac. I have both Xcode and command line tools installed. Whenever I run it, the terminal comes up with this:

1
2
3
4
5
6
Last login: Sat Jul 19 03:07:20 on ttys000
mac:~ david$ /Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/david/Desktop/David/Creating Games/First/bin/Debug/First 
sh: /Users/david/Desktop/David/Creating: No such file or directory

Process returned 127 (0x7F)   execution time : 0.015 s
Press ENTER to continue.


and once I press enter nothing happens.
just in case, here is the hello world code:

1
2
3
4
5
6
7
8
9
  #include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}

Thanks in advance for any help!
The code is correct, but I recommend you to write:

cin.get();

After the 7th line, to be sure it doesn't automatically close.

Anyway, the problem is yours (maybe compiler or something set wrong in the computer), the code is perfect. ;)
Thanks for clearing things up! That's just what I feared though, do you know maybe something other I have to install? or perhaps another fix to this problem? If you need any more info about my mac, i'd be happy to provide it.
Sorry but I'm a windows user and got no idea about mac. I don't know if it's avaible for mac but I recommend you to use DevC++ or CodeBlocks compilers, they are really good.

Also be sure to check if the compiler that you used got the correct rights (for example, root in linux or administrator in windows).
Topic archived. No new replies allowed.