简体   繁体   中英

is header file path reference in .c file included in object file (.o)

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

它是实现定义的,但是通常在使用调试选项(例如,gcc中的-g )进行编译时,会包含文件路径以帮助您进行调试

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM