目录
包管理工具
当我们需要使用别人开发的库时,可能会需要去下载其源码然后编译再引入我们的项目,这样做的话一来引用的库多了比较麻烦,而且需要自己管理这些包,二来一旦迁移到其他机子上就得复制过去或是再下载编译一次,尤其对跨平台项目来说简直苦不堪言,因此会有包管理工具的出现。
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就成功了
Increasing bedroom performance emperor vigor tonic can hold a broader significance for men beyond just the bedroom itself. It can impact their overall quality of life and boost their confidence. A fulfilling intimate life can increase their emotional well-being, leading to greater life satisfaction. Thanks to the unique and natural ingredients that make up the blend of Emperor’s Vigor Tonic, this product can work to provide the necessary and beneficial herbal nourishment for men’s bodies.
buy generic viagra online: buy sildenafil online usa – viagra canada
Diet & exercise Keto acv gummies will always be key in conjunction with a dietary supplement. We have all seen the keto gummies & diet pills to lose weight claims all over social media. Reliable keto & weight loss supplements may help boost your metabolism. They should help provide you with more energy and help you live a healthier lifestyle and help make your diet & exercise more efficient. Each of these special all-natural ingredients are packed into a bite-sized gummy candy made with natural flavoring and sweeteners and no added sugar.
We provide Book airline tickets tours & hotels booking that are within your budget and we also we design a holiday package that sits perfectly within your budget. We provide best deals in American Airlines, Delta Airlines, British Airways, Air Canada and Qantas Airlines. Helps Travellers in providing fast and confirmed tickets of flight, tour, or hotel.
After buying a Shark Tank staggering 25% share in the sisters company the Shark Tank panel have personally mentored the pair, helping them undergo re-branding and re-packing of their miracle product. Never before had the judging panel unanimously decided to each invest over a million dollars into a potential company. we appointed our research department to conduct their own investigation into the Shark Tank Weight Loss Gummies.
This will help you Airline Ticket Reservation find romantic, adventurous, or chilled-out properties. Once all your arrangements are done, you can plan your itinerary, pack your bags, and countdown the days until your much-awaited getaway. We are experienced, good-natured team with years of involvement in the flight tickets and vacation packages booking sector. This will help you find romantic, adventurous, or chilled-out properties.
The unique formula of Serolean Review is designed not just for those seeking weight management solutions, but also for individuals looking to improve their sleep quality, energy levels, and mental clarity. Serolean is a ground-breaking supplement designed to naturally boost serotonin levels and metabolism. Backed by genuine user testimonials and scientific insights, Serolean stands as a testament to the synergy of nature and science, offering a natural solution for those aiming to achieve a balanced and healthier lifestyle.
cialis au: Buy Tadalafil 20mg – cialis with dapoxetine overnight delivery australia
I’m impressed, I have to admit. Seldom do I come across a blog that’s both equally educative and entertaining, and let me tell you, you have hit the nail on the head. The issue is an issue that too few men and women are speaking intelligently about. Now i’m very happy that I came across this during my search for something concerning this.
http://sildenafil.llc/# buy viagra professional
http://sildenafil.llc/# viagra generic
viagra without a doctor prescription usa: Viagra online price – generic viagra 100mg
https://avanafil.pro/# farmacie online affidabili
http://avanafil.pro/# farmaci senza ricetta elenco
Farmacia online miglior prezzo: farmacia online migliore – comprare farmaci online all’estero
farmacia online piГ№ conveniente: Avanafil compresse – top farmacia online
After looking at a number of the articles on your website, I truly appreciate your technique of blogging. I bookmarked it to my bookmark website list and will be checking back soon. Please check out my website too and tell me how you feel.
I love reading an article that will make men and women think. Also, thank you for allowing me to comment.
Farmacia online piГ№ conveniente: avanafil 100 mg prezzo – farmacie online sicure
http://kamagrait.pro/# acquistare farmaci senza ricetta
https://viagragenerico.site/# viagra pfizer 25mg prezzo
farmacie online affidabili: Cialis generico controindicazioni – farmacie online affidabili
п»їFarmacia online migliore: Avanafil compresse – farmaci senza ricetta elenco
top farmacia online: Farmacie online sicure – migliori farmacie online 2024
Your style is unique compared to other people I have read stuff from. Many thanks for posting when you have the opportunity, Guess I’ll just book mark this blog.
Farmacia online piГ№ conveniente: Cialis generico controindicazioni – acquistare farmaci senza ricetta
Farmacie online sicure: Avanafil a cosa serve – comprare farmaci online all’estero
cialis farmacia senza ricetta: viagra prezzo – dove acquistare viagra in modo sicuro
https://farmait.store/# п»їFarmacia online migliore
http://avanafil.pro/# top farmacia online
Hi, I do believe this is an excellent blog. I stumbledupon it 😉 I may come back once again since I bookmarked it. Money and freedom is the best way to change, may you be rich and continue to help others.
п»їFarmacia online migliore: Farmacia online piu conveniente – acquisto farmaci con ricetta
migliori farmacie online 2024: kamagra oral jelly consegna 24 ore – farmacia online
alternativa al viagra senza ricetta in farmacia: viagra online siti sicuri – viagra naturale in farmacia senza ricetta
farmacie online autorizzate elenco: kamagra oral jelly – comprare farmaci online con ricetta
viagra prezzo farmacia 2023: viagra farmacia – miglior sito per comprare viagra online
farmacie online autorizzate elenco: Cialis generico recensioni – farmaci senza ricetta elenco
I quite like reading an article that can make people think. Also, thanks for allowing me to comment.
prednisone capsules: where can i order prednisone 20mg – prednisone over the counter
http://zithromaxbestprice.pro/# zithromax cost canada
propecia buy: order propecia without a prescription – buying cheap propecia
5 mg prednisone daily: 10 mg prednisone tablets – buy prednisone no prescription
Spot on with this write-up, I seriously believe this site needs far more attention. I’ll probably be returning to see more, thanks for the info.
http://propeciabestprice.pro/# order generic propecia no prescription
https://propeciabestprice.pro/# propecia without prescription
I have not checked in here for a while as I thought it was getting boring, but the last few posts are good quality so I guess I’ll add you back to my daily bloglist. You deserve it my friend 🙂
how does tamoxifen work: low dose tamoxifen – tamoxifen vs raloxifene
buy misoprostol over the counter: cytotec abortion pill – Abortion pills online
prednisone buy: prednisone 20 mg – can i buy prednisone online in uk
buy zithromax online: zithromax over the counter canada – can you buy zithromax over the counter in australia