detly
detly

Reputation: 30332

Can VS2010 show me which header file pulls in a declaration?

I have a header file in a mixed C/C++ project, call it A.h, that uses a type declared in another header file, say X.h. A.h does not include X.h directly, but includes other header files that, themselves, include other header files, etc., that eventually include X.h.

I'd like to know which of the header files included by A.h are indirectly responsible for pulling in this type declaration from X.h, without manually recursively inspecting the entire hierarchy of header files myself.

Can Visual Studio 2010 show me this information?

Upvotes: 2

Views: 183

Answers (1)

Luchian Grigore
Luchian Grigore

Reputation: 258568

Yes, there's a compiler option that allows you to see which headers are included and when.

It's /showIncludes and you can find it in the advanced project properties.

Upvotes: 2

Related Questions