Tag Archives: VC++ project dependencies

VC + + compiler can not find the header file and rebuild failure

1. The header file cannot be found

If the associated path of the header file is not set properly, you need to add both the root directory and the subdirectory to the additional header file directory. For example, if there are two header files in the root directory and the subdirectories sub1 and sub2 that need to be referenced elsewhere, you should add the header file path to the additional package directory in this way:

$(SolutionDir)root

$(SolutionDir)root\sub1

$(SolutionDir)root\sub2

2. It is successful to compile a library alone, but rebuild prompts that the related projects fail to compile

In this case, the lazy relationship between project references is not set well. You should right-click on the solution, – gt; common properties – & gt; project dependencies, and set the lazy relationship between project references without omission. In this way, the rebuild will succeed on the top-level project. At the same time, the compilation of dynamic library and other similar problems can also be solved.