<div dir="ltr">I'm having a go at using precompiled headers, but it doesn't seem to be working. What am I doing wrong?<br><br>C:\test>type a.h<br>#include <iostream><br>using namespace std;<br><br>C:\test>type a.cpp<br>#include "a.h"<br><br>int main() {<br>        cout << "test\n";<br>        return 0;<br>}<br><br>C:\test>clang --version<br>clang version 3.7.0 (tags/RELEASE_370/final)<br>Target: x86_64-pc-windows-msvc<br>Thread model: posix<br><br>C:\test>clang -fms-compatibility-version=19 -x c++-header a.h<br><br>C:\test>dir<br> Volume in drive C is OS<br> Volume Serial Number is C685-B1F1<br><br> Directory of C:\test<br><br>11/12/2015  15:51    <DIR>          .<br>11/12/2015  15:51    <DIR>          ..<br>11/12/2015  15:45                67 a.cpp<br>11/12/2015  15:44                41 a.h<br>11/12/2015  15:51         4,677,904 a.h.gch<br>11/12/2015  15:51               250 test.bat<br>               4 File(s)      4,678,262 bytes<br>               2 Dir(s)  181,629,882,368 bytes free<br><br>C:\test>clang-cl -fms-compatibility-version=19 -Xclang -include-pch a.h.gch a.cpp<br>error: invalid value 'precompiled-header' in '-x precompiled-header'<br>error: unable to read PCH file -o: 'no such file or directory'<br>error: error reading 'C:\Users\w\AppData\Local\Temp\a-1b7148.obj'<br>error: unable to read PCH file -o: 'no such file or directory'<br>fatal error: malformed or corrupted AST file: 'Unable to load module "-o": module file not found'<br>4 errors generated.<br><br>C:\test>clang-cl -fms-compatibility-version=19 -Xclang -include-pch a.h a.cpp<br>error: unable to read PCH file -o: 'no such file or directory'<br>fatal error: malformed or corrupted AST file: 'Unable to load module "-o": module file not found'<br>2 errors generated.<br>error: unable to read PCH file -o: 'no such file or directory'<br>error: error reading 'C:\Users\w\AppData\Local\Temp\a-5cd097.obj'<br>error: unable to read PCH file -o: 'no such file or directory'<br>fatal error: malformed or corrupted AST file: 'Unable to load module "-o": module file not found'<br>4 errors generated.<br><br>C:\test>dir<br> Volume in drive C is OS<br> Volume Serial Number is C685-B1F1<br><br> Directory of C:\test<br><br>11/12/2015  15:51    <DIR>          .<br>11/12/2015  15:51    <DIR>          ..<br>11/12/2015  15:45                67 a.cpp<br>11/12/2015  15:44                41 a.h<br>11/12/2015  15:51               250 test.bat<br>               3 File(s)            358 bytes<br>               2 Dir(s)  181,634,908,160 bytes free<br></div>