title: Visual Studio 2019: Cannot `import` C++ Standard Library declaration in cpp file without importing it in a separate module (ixx) first
body: <p>When attempting to use the C++20 <code>import</code> command to load a Standard Library declaration in a .cpp file, a compiler error saying the &quot;header unit&quot; cannot be found is returned.</p>
  <p>For example, in a file, say <em>Main.cpp</em>, I put</p>
  <pre><code>import &lt;iostream&gt;;
  
  int main()
  {
  
      return 0;
  }
  
  </code></pre>
  <p>The following compiler error results:</p>
  <p><code>error C7612: could not find header unit for 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\iostream'</code></p>
  <p>However, if I add a module to the project, say <em>Test.ixx</em>, as follows</p>
  <pre><code>export module Test;
  import &lt;iostream&gt;;
  </code></pre>
  <p>and then import the module <code>Test</code> in Main.cpp:</p>
  <pre><code>import Test;
  import &lt;iostream&gt;;
  
  int main()
  {
  
      return 0;
  }
  </code></pre>
  <p>Then, no problem.  The code builds just fine.</p>
  <p>Is this just a case of the C++20 compiler implementations still being worked out?  My impression so far has been that the Standard Library headers should be &quot;importable&quot; unconditionally -- ie without requiring an <code>import</code> in a module elsewhere -- but then I've only recently started to experiment with new features in C++20.</p>
  <p>Note: I've tried this out with other Standard Library declarations as well, eg <code>&lt;vector&gt;</code> etc, with the same results.</p>