title: How to fix "no matching function for call to 'wprintf'" in libclang on windows' visual studio 2015
body: <p>I'm using libclang to analyse code, because my project has too many files, so I need clang's precompiled headers to speed up.</p>
  
  <p>First I save the pch file in disk, but when using it, libclang give errors.</p>
  
  <pre><code> const char* custom_args[] = {
      "-fms-extensions",
      "-fms-compatibility",
      "-fms-compatibility-version=19.0.24215",
      "-std=c++17",
      "-fcxx-exceptions",
      "-fexceptions",
  
      "-fshort-wchar",
  
  
      "-v",
      "-w",
      "-xc++-header",
      "D:\\src\\stdafx.h",
  };
  
  // Create and save pch.
  CXTranslationUnit tu = clang_parseTranslationUnit(idx, NULL,
          cl_argv, cl_argc,
          NULL, 0,
          CXTranslationUnit_ForSerialization | CXTranslationUnit_CreatePreambleOnFirstParse);
  
  
      clang_saveTranslationUnit(tu,
          "D:\\src\\stdafx.h.pch", clang_defaultSaveOptions(tu));
  
  // using pch to speed the procedure of parsing another file.
  const char* code_args[] = {
      "-fms-extensions",
      "-fms-compatibility",
      "-fms-compatibility-version=19.0.24215",
      "-std=c++17",
      "-fcxx-exceptions",
      "-fexceptions",
  
      "-fshort-wchar",
  
      "-v",
      "-w",
      "-xc++",
      "-include-pch",
      "D:\\src\\stdafx.h.pch",
      "D:\\src\\my_file.cpp"
  };
  CXTranslationUnit tu = clang_parseTranslationUnit(idx, NULL,
          code_cl_argv, code_cl_argc,
          NULL, 0,
          CXTranslationUnit_KeepGoing);
  </code></pre>
  
  <p>The libclang's error as following:</p>
  
  <pre><code>D:\src\my_file.cpp:66:5: error: no matching function for call to 'wprintf'
  C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt_wstdio.h:605:37: note: candidate function not viable: no known conversion from 'asl::char16 *' (aka 'unsigned short *') to 'const wchar_t *const' for 1st argument
  </code></pre>
  
  <p>Could someone help me solve this problem?</p>