<div dir="ltr">Hi Vasily:<div><br></div><div>You can only include one precompiled header per compilation, so the second -include should just include the regular header, but since you changed the path, clang couldn't find it.</div><div><br></div><div>Pretty sure clang pch works just like gcc, so here's the gcc page which gives a lot more detail:</div><div><br></div><div> <a href="https://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html">https://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html</a></div><div><br></div><div>hth...</div><div>don</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 12, 2016 at 9:21 AM, Vasily Romanikhin via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello all, <div><br></div><div>I have a question about <b>-include</b> option. </div><div>Imagine that I have <b>main.c</b> which depends on <b>mylib1.h</b> and <b>mylib2.h</b><br></div><div><br></div><div>I can easily compile it using the follow command:</div><div><font face="monospace, monospace">clang -include lib/mylib1.h -include lib/mylib2.h main.c -o </font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">But if I precompile two header: <b>pch</b><b>/mylib1.h.pch</b> and<b> </b><font style="font-weight:bold">pch</font><b>/mylib2.h.pch </b>and try to use with -<b>include</b> option, it doesn't work:</font></div><div><div><span style="font-family:monospace,monospace">clang -include pch/mylib1.h -include pch/mylib2.h main.c -o </span><br></div></div><div><div><font face="monospace, monospace"><built-in>:1:10: fatal error: 'mylib2.h' file not found</font></div><div><font face="monospace, monospace">#include "mylib2.h"</font></div><div><font face="monospace, monospace"> ^</font></div><div><font face="monospace, monospace">1 error generated.</font></div></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">Please note that the same works fine for one precompiled header.</font></div><div><font face="monospace, monospace">Could anybody explain me that behaviour. </font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">Thanks an advance,</font></div><div><font face="monospace, monospace">Vasily </font></div></div>
<br>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>