title: clang++ fails to compile hello world
body: <p>I installed clang in my conda environment along with gcc. Their versions are</p>
  
  <pre><code>gcc     7.2.0
  clang   7.0.0
  libcxx  7.0.0
  </code></pre>
  
  <p>I then created an <a href="https://en.wikipedia.org/wiki/C%2B%2B#Language" rel="nofollow noreferrer">hello world</a> src file <code>a.cpp</code></p>
  
  <ol>
  <li><p>If I compile the file using <code>clang++ a.cpp</code>. The error reads</p>
  
  <pre><code>a.cpp:1:10: fatal error: 'iostream' file not found
  #include &lt;iostream&gt;
           ^~~~~~~~~~
  1 error generated.
  </code></pre></li>
  <li><p>Using <code>clang++ a.cpp --stdlib=libstdc++</code>, the error is the same</p></li>
  <li><p>Using <code>clang++ a.cpp --stdlib=libc++</code>, the error becomes</p>
  
  <pre><code>~/conda/envs/test/bin/ld: cannot find crtbegin.o: No such file or directory
  ~/conda/envs/test/bin/ld: cannot find -lgcc
  clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre></li>
  <li><p>Using <code>clang++ a.cpp -I$HOME/conda/envs/test/include/c++/7.2.0</code></p>
  
  <pre><code>In file included from a.cpp:1:
  /site/home/shliu/conda/envs/test/include/c++/7.2.0/iostream:38:10: fatal error: 'bits/c++config.h' file not found
  #include &lt;bits/c++config.h&gt;
           ^~~~~~~~~~~~~~~~~~
  1 error generated.
  </code></pre></li>
  </ol>
  
  <p>I use a shared computer so I cannot install system wide compilers and header files.</p>
  
  <h3>Questions:</h3>
  
  <ol>
  <li>What should I do to have it work? </li>
  <li>If <code>clang</code> does not ship with its own header files and I need to use what are provided by <code>gcc</code>, should I consider the compatibility of <code>clang version</code> and the <code>gcc version</code>? </li>
  <li>Do I need to install <code>libc++</code> in the same conda environment in order to use <code>clang++</code>?</li>
  </ol>
  
  <hr>
  
  <p>After some test, I found the way to do it in conda, which is posted as the an answer. However, I still don't understand how <code>clang</code> works, especially its relation with <code>gcc</code>. I would appreciate it very much if any one could answer (and I will accept that as the answer to this post): </p>
  
  <ol>
  <li>Does <code>clang</code> forward all the jobs to <code>gcc</code> so we always need the <code>gcc</code> tool chain to be installed in order to use <code>clang</code>?</li>
  <li>I found an include folder for <code>clang</code>, which is <code>$HOME/conda/envs/test/include/c++/v1</code> alongside with <code>$HOME/conda/envs/test/include/c++/7.2.0</code> which is from <code>gcc</code>. But if the <code>--gcc-toolchain</code> has been specified, the <code>v1</code> folder is not searched for headers, (which can be seen from the output by adding <code>-v</code> to the compiler. Then what is the usage of the <code>v1</code> include files?</li>
  </ol>