[cfe-dev] clang headers - can they be included from a memory location?

Graham Wakefield wakefield at mat.ucsb.edu
Fri Oct 22 08:29:30 PDT 2010


On Oct 21, 2010, at 8:49 AM, Douglas Gregor wrote:

> On Oct 20, 2010, at 11:27 PM, Graham Wakefield wrote:
> 
>> What would the full path name be? I want a directive like #include "remapped.h" to resolve to the contents of a preloaded buffer. 
>> 
>> Tried 'faking it' with a path like /usr/local/remapped.h? -> error src line 10 col 10: 'remapped.h' file not found
> 
> You mean /usr/local/include/remapped.h, I assume? I think that should work. I think I see the issue, below...

Email typo!

> You need to add the remapped file before you create the Preprocessor object. Otherwise, the remapping doesn't migrate from the options in CompilerInvocation over to the Preprocessor object itself.

Brilliant, that works! Thanks! 





More information about the cfe-dev mailing list