0

If I use the -E flag when compiling, I get the pre-processed output.

Some of the lines in this output is :-

# 4 "../Framework.h" 2
# 1 "../Basic.h" 1
# 1 "/usr/include/c++/4.1.2/queue" 1 3

What does it mean? Is there a source that you can point me to for more information?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
owagh
  • 3,428
  • 2
  • 31
  • 53
  • Possible duplicate of [What is the meaning of lines starting with a hash sign and number like '# 1 "a.c"' in the gcc preprocessor output?](http://stackoverflow.com/questions/5370539/what-is-the-meaning-of-lines-starting-with-a-hash-sign-and-number-like-1-a-c) – jww Feb 28 '17 at 02:40

1 Answers1

0

They are information for the compiler (and later the debugger if the compiler generates debug information) about the processed code. I don't know the exact syntax, but they inform of the include path, location of the '#include' directives in the including file and location of the next line not removed by the preprocessor in the included file. With that information (and counting the lines that are not annotated) the compiler can provide you with diagnostics that will point you to the correct line and how it got included.

David Rodríguez - dribeas
  • 204,818
  • 23
  • 294
  • 489
  • Well I vaguely figured that out myself. Unfortunately, my compiler seems to be including some headers out of order and I want to figure out why (it's a bug in my code obviously). A more precise answer with exact syntax (for icpc12 if there is no generic answer) would be appreciated. – owagh Jun 22 '12 at 20:02
  • @owagh: All your headers should include their respective dependencies, which in turn means that the order of inclusion is irrelevant. Yes, it is an issue in your code, and you should fix it by just looking at the compiler errors: whenever it tells you that a dependency (identifier is not recognized), add the include directive to that file, recompile, look at the errors... – David Rodríguez - dribeas Jun 22 '12 at 22:37
  • @owagh: And the answer is still the same: make your headers independent of the inclusion order, name all dependencies by either forward declaring the types, or including the headers that define/declare them. – David Rodríguez - dribeas Jun 22 '12 at 22:42