About "the dependency was added by the project system and cannot be removed" error

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.