1

I'm having some nasty error with one header file being included with different linkages (namely, stdio.h with and withoun "extern C"). So, I need to find where one specific header file is included.

I am aware of doxygen but unfortunately the header I'm interested is stdio.h, which is also included by Qt. So the only way (that I'm familiar with) to use doxygen - is to scan entire Qt folder. That could take forever.

So, is it possible to find out, where one header is included, without drawing include graphs for every headers in the project? Or is there some other way of solving this?

3
  • 2
    You can try gcc -E to preprocess the file and see where the header file comes from; or you can just search your -Ipath where the header file is. Commented Apr 29, 2014 at 14:19
  • Thanks you! That is a possible way indeed, though not as vivid as include graph Commented Apr 29, 2014 at 14:37
  • @Mine could you please make your comment an answer so I can accept it? Commented Apr 29, 2014 at 14:45

2 Answers 2

2

You can try gcc -E to preprocess the file and see where the header file comes from;

Or you can just search your -Ipath where the header file is.

Sign up to request clarification or add additional context in comments.

Comments

0

I'd use grep:

grep --color --binary-files=without-match -R -n -i "stdio.h" *

that will recursively search down a tree, examining every text file for stdio.h, printing each match with the file name and line number where it was found.

2 Comments

I'm on windows, so that's not exactly the answer for me :)
I am too. There are a number of ports of grep for Windows. Cygwin works well, and gives you bash and a bunch of other tools too. Also, the built in Windows explorer search will do string searches inside files in indexed locations.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.