当前位置:网站首页>Getting started with vcpkg

Getting started with vcpkg

2022-04-23 18:52:00 Brick Porter

About VCPKG Compile and use basic methods , Other articles have made it clear . I also learned a lot according to the articles of leaders . Let's talk about my usage findings .

One 、 The library and its support library are always updated , So it usually takes a period of time to update , In order to obtain the support of the newly added Library .

Two 、 How to know which libraries it supports , see Under subdirectories ports. Each folder corresponds to a library .vcpkg install Add the name of this directory to install the corresponding library .

3、 ... and 、 Some libraries provide some options and some compilation and library features . Use this parameter :

vcpkg install Library name [ Options ]: Version options

Library name , How to check has been mentioned above , open ports Under the directory of the library vcpkg.json File to see the options it supports . Let's say curl Support brotli Format support, i.e Accept-Encoding Can support br. By default vcpkg The default compilation option can only decompress gzip Format . open ports/curl In the catalog vcpkg.json You know , see default-features Node can know , By default, the options it uses are "non-http", "ssl",features All the options it supports are listed under the node , You can know brotli Also supported, so use vcpkg install curl[brotli]:x86-windows Can be compiled to support brotli The library of . Of course, there are many options under it , You need other support to add it .

Besides , stay vs2019 or 2022 Has directly provided vcpkg Support for , If installed vcpkg In the future, there will be one more compilation option vcpkg The tab of .

  If you use x86-windows-static/x64-windows-static Compiled the static library , Then pay attention to use static libraries Change to yes , Otherwise, the compilation will fail to link the library .

版权声明
本文为[Brick Porter]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210603257228.html