I'm getting this error
clang: error: linker command failed with exit code 1 (use -v to see invocation)
using namespace std;
// main() is where program execution begins.
cout << "Hello World"; // prints Hello World
gcc hello.cpp should be
gcc is for compiling and linking C code, while
g++ is used for C++ code as you have it.
I think it might conflict with XCode compiler?
No. The point is that the
gcc command is also able to compile C++ code detected from the
.cpp file extension, though the
libstdc++.a won't be linked automatically.