目录
包管理工具
当我们需要使用别人开发的库时,可能会需要去下载其源码然后编译再引入我们的项目,这样做的话一来引用的库多了比较麻烦,而且需要自己管理这些包,二来一旦迁移到其他机子上就得复制过去或是再下载编译一次,尤其对跨平台项目来说简直苦不堪言,因此会有包管理工具的出现。
vcpkg
它是由微软开发的,可以像安装普通软件一样地安装库,而且和visual studio/cmake很契合,在win和linux都可用。
安装
- 先找一个你希望安装vcpkg的位置,这里使用ubuntu示例,路径选在/home/coolight/app
- 打开控制台,来到上述路径,然后执行命令(需要先安装git,请忽略命令前的 $ ):
$ git clone https://github.com/microsoft/vcpkg
- 由于网络原因,可能会拉取失败,如果你能搭梯子最好,不能的话就多试几次或者换wifi/移动数据等尝试。
- 下载完成后在当前目录下就会有一个叫vcpkg的目录
- 进入vcpkg目录,注意它有两个文件:
- bootstrap-vcpkg.sh:linux系统请执行这个文件(执行命令 ./bootstrap-vcpkg.sh )
- bootstrap-vcpkg.bat:win系统请执行这个文件(双击打开或执行命令 bootstrap-vcpkg.bat)
- 执行完后就会出现上图中最后的那个vcpkg可执行文件,win系统下为vcpkg.exe。至此就安装完成了
- 当然目前只能在这个目录运行vcpkg来安装、升级等操作,设置环境变量即可在任意地方都可以运行。
常用命令
搜索库
- ./vcpkg search [库名]
- 搜索可安装的包,示例:
安装库
- ./vcpkg install [库名]:[位数-系统环境] [可选参数]
- 位数有x86和64;x86即32位,x64即64位。可以省略,win下默认安装32位,linux下默认安装64位。
- 系统环境可以是windows,linux等,可以省略,默认会安装当前系统环境对应的库,可以通过命令查看:./vcpkg help triplet
- win下默认会安装x86版本,而linux下默认是x64。可以设置环境变量修改这个默认安装的版本:
- VCPKG_DEFAULT_TRIPLET=x64-windows
- -
- 可选参数有很多,比如:
- --head,安装库的最新的版本
- --dry-run,不做任何实质上的下载安装,仅显示将要被安装的库的名称和版本信息
- ......
- 例如:
- 安装spdlog:./vcpkg install spdlog
- 安装openssl并指定安装win的64位:./vcpkg install openssl:x64-windows
- 可选参数有很多,比如:
卸载库
- ./vcpkg remove [库名]
- ./vcpkg remove --outdated 卸载所有过期的库
列出已安装库
- ./vcpkg list
集成到开发环境
- ./vcpkg integrate install
- 需要执行这一句才能“通知”到vs或是cmake使用这些安装的库
问题
如果使用vcpkg安装库,更新等过程中报错,请一定一定要耐心看它的错误信息,往往它会告诉你解决办法,比如因缺少依赖软件需要安装;因网络问题文件下载失败,需要重试等等。
安装库之后导入使用依然报错
- 可能你没有让vcpkg集成过去,需要执行:./vcpkg integrate install
- 如果使用的是cmake,安装后还需要在项目的CMakelist.txt配置相应的编译链接,这些一般在vcpkg安装库完成后会提示:
如何重装/卸载vcpkg
- 我一直是直接把整个vcpkg文件夹删了就是卸载了,然后重新走一次教程安装就是重装
ubuntu下安装ICU一直在最后出错
- 其实第一次出错的时候有提示说需要一个叫autoconf的程序但还没安装找不到
- 但我执行 sudo apt install autoconf 之后还是出错
- 后来根据vcpkg的提示去看了错误日志文件:[vcpkg root]/buildtrees/icu/config-x64-linux-dbg-err.log
- 里面就提示错误是因为找不到 autoconf-archive
- 因此执行sudo apt install autoconf-archive 安装上再运行vcpkg重新安装ICU就成功了
Another benefit of having extensive patient data is that physicians can give personalized care, boosting patient’s satisfaction with business intelligence software for the healthcare industry.
п»їbest mexican online pharmacies: Purple pharmacy online ordering – buying from online mexican pharmacy
http://indiapharmacy.shop/# п»їlegitimate online pharmacies india
Attractive section of content. I just stumbled upon your site and in accession capital to assert that I acquire in fact enjoyed account your blog posts. Any way I’ll be subscribing to your feeds and even I achievement you access consistently quickly.
https://indiapharmacy.shop/# cheapest online pharmacy india
A fascinating discussion is definitely worth comment. I do believe that you need to write more on this subject, it may not be a taboo subject but typically people don’t discuss such topics. To the next! Many thanks.
india pharmacy: Indian pharmacy online – Online medicine order
http://indiapharmacy.shop/# india pharmacy
top 10 online pharmacy in india: Online India pharmacy – indian pharmacy online
Sangat menginspirasi! ✨ Berapa gaji rata-rata dari seorang penulis di blog ini? Saya ingin menjadi bagian dari tim!
cheap ed: ed pills online – low cost ed pills
Where such risk elimination isn’t possible, the risks must be reduced and residual risk controlled.
In 1969, Moore was appointed U.S.
https://indiapharmacy.shop/# indian pharmacy online
Very good post. I’m facing a few of these issues as well..
http://edpillpharmacy.store/# buy ed meds online
The final step in your forex trading plan should be to work your way up to a full scale trading system.
mail order pharmacy india: Online India pharmacy – Online medicine order
Truly liked going through this post. It’s highly enlightening and well-organized. Fantastic effort!
Even in the most successful marriages, there are times of doubt, but what holds couples together is an underlying love for each other.
cheapest ed meds: Cheapest online ED treatment – best ed meds online
And 401 (k) plans further encourage savings because early withdrawals are accompanied by a penalty.
https://indiapharmacy.shop/# best online pharmacy india
https://mexicopharmacy.win/# buying prescription drugs in mexico online
mexican drugstore online: Best pharmacy in Mexico – medicine in mexico pharmacies
http://mexicopharmacy.win/# best online pharmacies in mexico
The next time I read a blog, Hopefully it won’t disappoint me as much as this particular one. I mean, Yes, it was my choice to read through, however I truly thought you’d have something interesting to say. All I hear is a bunch of moaning about something that you could possibly fix if you weren’t too busy looking for attention.
india pharmacy: Online medicine home delivery – india pharmacy mail order
Loved this entry. It’s highly detailed and filled with valuable details. Fantastic effort!
https://indiapharmacy.shop/# buy medicines online in india
https://indiapharmacy.shop/# reputable indian pharmacies
order ed pills online
http://edpillpharmacy.store/# cheap ed
online erectile dysfunction
This article is great. I picked up tons from going through it. The information is extremely educational and structured.
buying prescription drugs in mexico: mexican pharmacy – best online pharmacies in mexico
mexican rx online: Mexico pharmacy online – pharmacies in mexico that ship to usa
http://indiapharmacy.shop/# reputable indian online pharmacy
online erectile dysfunction pills
http://edpillpharmacy.store/# buy ed pills
online prescription for ed
http://edpillpharmacy.store/# ed medication online
http://mexicopharmacy.win/# reputable mexican pharmacies online
cheapest online pharmacy india: Online India pharmacy – buy prescription drugs from india
https://edpillpharmacy.store/# order ed meds online
erectile dysfunction drugs online
http://edpillpharmacy.store/# п»їed pills online
cheap erection pills
does cialis really work: cialis without a doctor prescription – generic cialis soft tabs
A virtual best vpn service private network is a service that gives you more security when you connect to the internet, regardless of whether you’re at home, work or on public Wi-Fi. A VPN masks your IP address when you use the internet, which keeps your activity online private and your identity safe. It blocks your IP address, your identity and any data you send or receive online from prying eyes. Using a VPN makes you virtually untraceable because your IP is masked, so no one can pinpoint you.
Hostinger is a Best Web Hosting professional website hosting platform with all the right features. It has a limited basic plan that’s perfect for small or single-employee businesses looking for quality service for less. Customer support is friendly and available at all hours to help you when problems arise. Keep your website running smoothly with a hosting company that guarantees you good uptime, fast load times and easy setup.
Before getting Pet Insurance Plans started with a pet insurance plan make sure to familiarize yourself with how pet insurance works and what plan is best for your furry friend. To help you get started, we’ve compiled a list of some of the most commonly asked questions about pet insurance to help make sure your dog or cat is fully covered and protected. Pet insurance offers financial protection for the health and wellness of your furry family members. Compare & find the top health insurance plans that will make your pet’s tail wag.
Purchasing a Top Mattress mattress online has become increasingly popular, and for good reason. The convenience of being able to research, compare and order a mattress from the comfort of your home cannot be overstated. But with so many options available, it can be overwhelming to find the perfect fit. In this article, we will guide you through the essential aspects to consider while shopping for a luxurious quality mattress online, ensuring you get the best sleep experience possible.
https://tadalafil.auction/# cialis wallmart
A hybrid mattress Top Mattresses combines an innerspring system with memory foam or latex layers, providing both body-contouring comfort and robust support. Its design enhances breathability compared to traditional memory foam mattresses due to the airflow-promoting innerspring layer. Essentially, hybrid mattresses aim to balance the benefits of their various components, offering a versatile sleep solution.With so many different brands and mattress types on the market, it can be difficult to know where to start.
When melanin breaks down and pools up purelumin essence within the second layer of your skin, it forms dark spots. PureLumin Essence is a dark spot-erasing breakthrough that prevents melanin from leaking to the surface of your skin. Purelumin essence is a meticulously crafted natural formula designed to help women dealing with dark spots. This one of a kind solution aims to support the body’s natural process to keep melanin under control and prevent it from leaking to the surface of the skin.