[cfe-dev] clang -include option

Vasily Romanikhin via cfe-dev cfe-dev at lists.llvm.org
Mon Dec 12 09:21:08 PST 2016


Hello all,

I have a question about *-include* option.
Imagine that I have *main.c* which depends on *mylib1.h* and *mylib2.h*

I can easily compile it using the follow command:
clang -include lib/mylib1.h -include lib/mylib2.h main.c -o


But if I precompile two header: *pch**/mylib1.h.pch* and pch*/mylib2.h.pch *and
try to use with -*include* option, it doesn't work:
clang -include pch/mylib1.h -include pch/mylib2.h main.c -o
<built-in>:1:10: fatal error: 'mylib2.h' file not found
#include "mylib2.h"
         ^
1 error generated.


Please note that the same works fine for one precompiled header.
Could anybody explain me that behaviour.

Thanks an advance,
Vasily
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20161212/aad3c2ef/attachment.html>


More information about the cfe-dev mailing list