I compile an example.c file that has the line:

#include "parse/properties/properties.h"

The compiler creates get an example.o file. Is the path to the header file included in the example.o file? or is that information external?

有帮助吗?

解决方案

It may or may not, the object file format is not standardised (the standard does not even mention "object files"). A compiler might insert the #include for debugging purposes, or it may skip it completely.

Note also that #include'ing is done by the compiler in what the standard desrcibes as the first phase in translation, using a textual preprocessor; the #include-directive tells the preprocessor to copy verbatim and inplace the contents of another file. This happens long before actual object files would be produced

其他提示

It is implementation defined but generally when you compile with debugging options ( eg -g in gcc ) the file paths are included to aid you in debugging

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top