Xcode and C ++ [Beginner] - Why does the Hello World program print all these extra things?


Whenever I build+run my program, it displays all this extra stuff:

GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Thu Nov 3 21:59:02 UTC 2011) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-apple-darwin".tty /dev/ttys000 [Switching to process 3022 thread 0x0]

Hello, World!

Program endedwith exit code: 0

Here is the Hello World, default code:

#include <iostream>

int main (int argc, const char * argv[])

    // insert code here...
    std::cout << "Hello, World!\n";
    return 0;

Why is it printing all the extra stuff, and how can I stop it? I'm using Xcode and C++. Thanks.

It's printing all of that extra stuff because it's running your executable in the debugger. You can change the popup from All Output to just "Target Output" like shown in the images below: