-2
#include <iostream>

using namespace std;
int main ()
{
   cout << "Hello World";
   return 0;
}

When I code simple C++ like that on Sublime Text 2 for Mac, I anytime get this kind of error.

File "/Users/Library/Application Support/Sublime Text 2/Packages/C++/untitled.cpp", line 3
using namespace std;
              ^
SyntaxError: invalid syntax
[Finished in 0.2s with exit code 1]

Do you guys have any suggestions to fix it?

1 Answers1

0

You will probably need to install the Xcode Command Line tools before you can compile from Sublime Text 2.

https://developer.apple.com/library/ios/technotes/tn2339/_index.html