A solution for a C + + project may consist of multiple sub-projects, and when a subproject calls other sub-projects, it is prone to multiple compilation problems, making the following records of the problems encountered in the work.
1. Generating a static library (Lib)
Select the current project, and then select the Project--Properties (or select items, right-click Properties)--Configure properties--general, and then modify the configuration type to static library (. Lib), such as:
2. Call the static library
This process can be broadly divided into three steps:
(1) Select items--Properties--Configure Properties--C + +, and then modify the "Additional Include Directories" to add the header file directories for the Static library (Lib), which can be used with absolute or relative paths, such as:
(2) Select items--Properties--Configure properties--connector, and then modify the "Additional Library directory" to add the static library (LIB) directory, you can use the absolute path or relative path, such as:
(3) Select the item--Properties--and configure properties---and the connector--enter, and then modify the additional dependencies to add the name of the Static library (Lib), such as:
3. Compile the project build executable file
When you call more than one static library to compile, you can see "Library file connection" and other errors, this time need to check the "Runtime Library" of multiple sub-projects is consistent, I have encountered such errors, this delay a lot of time, open the "Run-Time Library" step: Project--Properties--and configuration Properties-- -C + +---code generation such as:
C + + multi-project static library call problem