The setting of vs2019 source file and header file not in the same directory

Use VS2019 to build a C++ project. If you put the source files and header files in different target folders, you can do the following: Create two folders in the project folder, and place the header files and source files respectively. Click Show All Files in the Solution Explorer, and you will see the folder directory created under the path. At this time, you can add the newly created files, as shown in Figure 1. To create a new one later, you can right-click the corresponding folder and select New.

Figure 1 Adding files to the newly created folder
Insert picture description here
However, the path of the header file will not be found at this time, and the path of the header file should be included. As shown in Figure 2 and Figure 3.

Figure 2 Find the properties in the "Project" menu
Insert picture description here
Figure 3 Include the header file directory in the C/C++ General->Additional Include Directory
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_36439722/article/details/105185121