title: Include paths not found while compiling with g++ on MacOS
body: <p>I'm trying to compile the simplest program on MacOS 10.6 like:</p>
  
  <pre><code>$ g++ -o hello hello.cpp
  </code></pre>
  
  <p>the following source:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  int main (int argc, char * const argv[]) {
      std::cout &lt;&lt; "Hello, World!\n";
      return 0;
  }
  </code></pre>
  
  <p>I'm getting the error:</p>
  
  <pre><code>hello.cpp:1:20: error: iostream: No such file or directory
  hello.cpp: In function ‘int main(int, char* const*)’:
  hello.cpp:4: error: ‘cout’ is not a member of ‘std’
  </code></pre>
  
  <p>So obviously I have to add the include path somewhere. My question is <strong>where</strong> can I find the include directories and <strong>how</strong> can add them globally (I don't want to provide the include path whenever I want to compile).</p>
  
  <p>I just installed the XCode 3.1.4 and managed to compile it via Xcode, but not via command line. I found some header files in this directory:</p>
  
  <pre><code>/Xcode3.1.4/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers
  </code></pre>
  
  <p>and tried to add it to the HEADER_SEARCH_PATHS after reading <a href="https://stackoverflow.com/questions/749027/how-to-add-a-global-include-path-for-xcode">this</a> question, but no luck.</p>
  
  <p>I'm developing on Linux and everything is working fine there, but I want to continue doing that on MacOS. Any help?</p>