Why use environment variables instead of relative paths to include third-party libraries?

Source: Internet
Author: User

Author: Zhu Jincan

Our version control tool uses TortoiseSVN + VisualSVN. I am not quite familiar with one of my development team's practices, that is, after downloading code from SVN, I find that to include a third-party library, I need to add an environment variable first, which is similar to THIRD_PARTY_LIB, the value of this environment variable points to the Home Directory of the third-party library. Why not use relative directory paths to include third-party libraries? In this case, the newly added developer can directly compile the source code after downloading the source code, and does not need to manually add any environment variables. Today, I throw this question to the header, which tells me that it is more convenient to manage third-party libraries using environment variables. First, a third-party library has a version upgrade and file change problem, if a relative directory is used, the location of the third-party library is limited. If you want to change it later, you must change the settings of the source code project file one by one, and use environment variables, if this is not the case, you can create a folder for a new third-party library. You only need to change the value in the environment variable. The second is to use the branches and tags branches in SVN (note: branches: indicates the directory where the released version is stored, that is, the stable version released when the project is released is stored in this directory. Tags: the directory where tags are stored .). Because the branches and tags branches in SVN are constantly updated, it is definitely not appropriate to use relative directories, at the same time, when releasing the tag version, you do not need to package the dll of a third-party library when using environment variables, because these dll can be found through environment variables.

 


In short, the use of relative paths including third-party libraries is temporary convenience, resulting in a lot of inconvenience in the future. Using environment variables although you need to do more work At the beginning, it will have a lot of benefits for future work.

 

Related Article

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.