Owen
Owen

Reputation: 39366

In Visual Studio, what is the practical effect of adding a header file to the project?

In Visual Studio, I can add header files under "Header Files" in the solution explorer.

Do header files added in this manner play any role in the build, different from what they would do if they were merely present on the filesystem but not added to the project?

Upvotes: 1

Views: 75

Answers (1)

Steven
Steven

Reputation: 754

As far as I know, when compiling, there's no difference. The header file is either #included or not (and to find the header, its either in the include path or not) -- it doesn't matter if the header is listed in the project.

However, from an editing/IDE point of view, it does matter. For example, headers in the project will take part in search or search-and-replace.

Upvotes: 1

Related Questions