The meaning and usage of vs project property page

Modify the command to start debugging

If the breakpoint is set at the entrance of a program and it is inconvenient to debug it after the program is fully started, you can modify the command option under the debugging tab in the property page and change it to an exe. You can break the point first. Then set the project as the startup project, and then perform debugging startup

The current directory of the project property page

Paths such as the output directory and intermediate directory under the General tab in the properties are based on the path where the project file is located as the relative path to the current directory . The so-called project file is the .vcxproj file named after the project.

vcxproj file: Project project file, which describes various properties of the project. After modifying the file and then rebuilding it, VS will rebuild the project.

vcxproj.filter file: It can be understood as a view file, which defines the virtual directory structure of the project after it is opened in VS. When rebuilding after modifying this file, VS will not rebuild the project.

vcxproj.user file: It is a localized user configuration that allows multiple users to configure the project in their own preferred way (such as the form position when opening the project and other configurations that have nothing to do with the project content)

Macro configuration

You can often see $(xxxx) as the path or option value in the property page. This is a macro. You can view the definition of the macro in the edit tab. The true meaning of the macro will also be displayed below, making it easy to fill in and use.

The following is a detailed explanation of self-contained directories, library directories, additional include directories, additional library directories, and additional dependencies_Crazy blog-CSDN blog_Additional include directories VS include directories, library directories, additional include directories, and additional libraries in the project Directories and additional dependencies are configured under "Project->Properties->Configuration Properties". The specific instructions are as follows: VC++ directory: Include directory: Search directory for xxxx.h in #include Library directory: Look for .lib file Search directory C/C++: General -> Additional include directories: Search directory for xxxx.h in #include Linker: General -> Additional library directories: Look for .lib https://blog.csdn.net/u012043391/article /details/54972127

VC++ directory ( global )

Executable directory: the directory in which to search for executable files, path corresponds to the environment variable

Include directory : Search directory for xxxx.h in #include<xxxx.h>

Library Directory : Search directory to find .lib files

C/C++( current project )

Additional include directories : Look for the search directory for xxxx.h in #include<xxxx.h> (each item corresponds to a folder XXXX. The folder contains the header files required for compilation. When using, directly #include<XXXX >That's it)

 Linker

Additional library directory : Search directory for .lib files

Additional dependencies : lib library (C++ library will place the declaration of functions and classes in *.h, and the implementation in *.cpp or *.cc. After compilation, *.cpp, *.cc, *.c will be packaged into a .lib file to protect the source code)

Subsystem: The choice of subsystem affects which entry point symbol (or entry function) the linker will choose

Options

  • Not set  - The subsystem is not set.
  • Console  - Win32 character mode application. The operating system provides a console for console applications. If main or wmain is defined, console is the default.
  • A Windows application does not need a console, probably because it creates its own Windows in order to interact with the user. If WinMain or wWinMain is defined, the default is WINDOWS.
  • Native -device driver for Windows NT . If /DRIVER: WDM is specified, the default value is NATIVE.
  • Efi App  - Efi App.
  • Efi Startup Service Driver  - Efi Startup Service Driver.
  • EFI ROM  -EFI ROM。
  • Efi runtime  - Efi runtime.
  • Posix  - Applications that run with the posix subsystem in Windows NT.

Details: Linker property page | Microsoft Docs

common problem

1. The difference between include directories and additional include directories ( library directories and additional library directories ):

    Include directory : The value of the system include macro has been modified, which is global;

    Additional include directories : used for the current project and have no effect on other projects.

    (The difference between the library directory and the additional library directory is the same as above)

2. It can be seen that the difference between include directories and additional include directories ( library directories and additional library directories ) is mainly global or current. So when you need to add these directories to a project, usually, they are in the additional include directories and additional library directories. added in .

3. To use a library, in addition to including its header file ( additional include directory ), you must also add lib during the linking process ( additional library directory , additional dependencies ).

4.Add method:

    Additional include directory---Add the header file directory of the project:

      Project->Properties->Configuration Properties->C/C++->General->Additional include directories: add the directory where the header files are stored;

    Additional library directory---add the lib static library path referenced by the file:

      Project->Properties->Configuration Properties->Linker->General->Additional Library Directory: Add the storage directory of the lib file;

    Additional dependencies---Add the lib file name referenced by the project:

      Project->Properties->Configuration Properties->Linker->Input->Additional Dependencies: Add the lib file name.

5. When you need to add a .dll dynamic link library to the project , directly drag the .dll file that needs to be added to the folder where the .exe generated by the project is located (Project->Properties->Configuration Properties->General ->Output directory, you can see in which directory the .exe is generated).
 

Set project configuration

Generally, it is set to some common configurations. After setting it once, other local projects can directly inherit the configuration without setting it every time.

View----Other Windows----Property Manager, double-click Debug | Win32 to set it, and it will be effective for all projects after setting.

Guess you like

Origin blog.csdn.net/SwordArcher/article/details/124257379