Read a simple project code. One project basecode is static Lib, And the other project runbasecode uses this Lib, however, the reference to this Lib is not added to the "linker \ input \ additionaldependencies" set in the project, but basecode is found in "linker \ command line. lib has already been added. What is the problem?
First, we suspect that the "Project dependencies" Compilation dependency set in solution is implicitly added to Lib. Therefore, we want to remove the dependencies of runbasecode on basecode. When the dependency is canceled, the error "the dependency was added by the project system and cannot be removed" is returned. Where is the compilation dependency added?
It was originally set in "project references.
Right-click \ properties \ common properties \ framework and references \ add new reference.
After the reference is set, "Project dependencies" is automatically added to the project ".
By default, the reference to basecode. Lib is added. Is it because "project dependencies" is set? No, it is caused by setting "Reference" described above. The verification is as follows:
1. Click "Remove reference" to remove the Project Association. The default "project dependencies" is also canceled. In this case, manually add "project dependencies" and find that basecode. Lib is not automatically added to "linker \ command line.
2. remove "project dependencies" from the previous step, and then "right-click \ properties \ common properties \ framework and references \ add new reference ", basecode is automatically added to "linker \ command line. lib.
References
[1] error while removing project dependency in vs2010 (http://stackoverflow.com/questions/12818315/error-while-removing-project-dependency-in-vs2010)
[2] vs project dependency (http://www.cppblog.com/mythma/archive/2011/08/05/this_dependency_was_added_by_the_project_system_and_cannot_be_removed.html)