title: How to use Clang with C++ Modules in Windows 10
body: <p>I wanted to start testing and learn modules and move out of the days of header files and see if the experience differs. I installed everything required (Visual Studio module option in the installer), but Clang doesn't seem to be able to resolve the imports. When I switch over to MSVC on the other hand, it works fine. I'm currently working with VS 2019 Insider preview.
  So, how so I get clang (10, the latest release) to work?</p>
  
  <p>EDIT: The error in question is <code>module not found</code> with Clang. MSVC works fine. What flags do I need to pass to Clang so that it can find the modules installed my VS-Installer? For example, I pass CLI argument to MSVC to enable modules.  </p>
  
  <p>EDIT: 
  C++ File (main.cpp):</p>
  
  <pre><code>import std.core;
  int main() {
      std::cout &lt;&lt; "Hello CMake from C++20!\n" &lt;&lt; std::endl;
      return 0;
  }
  </code></pre>
  
  <p>CMake file</p>
  
  <pre><code>cmake_minimum_required (VERSION 3.16)  
  
  project ("cpp20" LANGUAGES CXX)
  
  set(CMAKE_CXX_STANDARD 20)
  set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
  
  add_compile_options(
      "$&lt;$&lt;CXX_COMPILER_ID:MSVC&gt;:/experimental:module&gt;"
  )
  
  add_executable (cpp20 "main.cpp" )
  
  add_compile_options(
      "$&lt;$&lt;CXX_COMPILER_ID:MSVC&gt;:/experimental:module&gt;"
  #   something here to let Clang use modules. I tried -fmodules, 
  #  -fmopodules-ts, -fbuiltin-module-map, -fimplicit-module-maps CLI, but none work.
  )
  </code></pre>
  
  <p>So, how do I get Clang to find the modules install by VS, or modules that it might have installed.</p>
  
  <p>Here is a <a href="https://drive.google.com/file/d/1vsvJtNMhPuWkBBgp8RxpO28TVR_MBTo7/view?usp=sharing" rel="nofollow noreferrer">zip</a> of the sample "Hello World" project. </p>
  
  <p>Thank you. </p>