目录
包管理工具
当我们需要使用别人开发的库时,可能会需要去下载其源码然后编译再引入我们的项目,这样做的话一来引用的库多了比较麻烦,而且需要自己管理这些包,二来一旦迁移到其他机子上就得复制过去或是再下载编译一次,尤其对跨平台项目来说简直苦不堪言,因此会有包管理工具的出现。
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就成功了
Xitox’s foot pads contain a combination of powerful herbs that help provide a soothing experience for your feet after a long day. https://xitox-web.com/
http://amoxila.pro/# where to buy amoxicillin pharmacy
Volca Burn is a weight loss supplement that uses a “red tingle hack” to help you rapidly lose weight without dieting or exercising. https://volcaburn-web.com/
prednisone pill 10 mg: buy 10 mg prednisone – buy prednisone 1 mg mexico
Keravita Pro™ is a dietary supplement created by Benjamin Jones that effectively addresses nail fungus and hair loss, promoting the growth of healthier and thicker nails and hair. The formula is designed to target the underlying causes of these health issues and provide comprehensive treatment. https://keravitapro-web.com
zithromax cost australia: buy zithromax 500mg online – order zithromax over the counter
HoneyBurn is a revolutionary liquid weight loss formula that stands as the epitome of excellence in the industry. https://honeyburn-web.com/
Gorilla Flow prostate is an all-natural dietary supplement for men which aims to decrease inflammation in the prostate to decrease common urinary tract issues such as frequent and night-time urination, leakage, or blocked urine stream. https://gorillaflow-web.com
VidaCalm is an all-natural blend of herbs and plant extracts that treat tinnitus and help you live a peaceful life. https://vidacalm-web.com/
Introducing TerraCalm, a soothing mask designed specifically for your toenails. Unlike serums and lotions that can be sticky and challenging to include in your daily routine, TerraCalm can be easily washed off after just a minute. https://terracalm-web.com/
Pineal XT is a revolutionary supplement that promotes proper pineal gland function and energy levels to support healthy body function. https://pinealxt-web.com/
GlucoBerry is one of the biggest all-natural dietary and biggest scientific breakthrough formulas ever in the health industry today. This is all because of its amazing high-quality cutting-edge formula that helps treat high blood sugar levels very naturally and effectively. https://glucoberry-web.com/
neurontin 400 mg neurontin capsule 600mg neurontin oral
http://zithromaxa.store/# zithromax antibiotic without prescription
Zeneara is marketed as an expert-formulated health supplement that can improve hearing and alleviate tinnitus, among other hearing issues. https://zeneara-web.com/
The human body can continue to live thanks to the correct functioning of certain systems. If even one of these systems does not work properly, it can cause problems in human life. https://calmlean-web.com/
buy cheap doxycycline online: buy doxycycline hyclate 100mg without a rx – where can i get doxycycline
how to buy doxycycline online: buy doxycycline 100mg – cheap doxycycline online
I strongly recommend steer clear of this site. My own encounter with it was purely frustration along with doubts about deceptive behavior. Exercise extreme caution, or even better, find a trustworthy service to fulfill your requirements.
I highly advise to avoid this site. My personal experience with it has been purely dismay and doubts about deceptive behavior. Proceed with extreme caution, or even better, seek out a trustworthy platform to fulfill your requirements.
I highly advise stay away from this site. The experience I had with it has been nothing but dismay along with doubts about fraudulent activities. Proceed with extreme caution, or even better, seek out a more reputable site to meet your needs.
amoxicillin generic amoxicillin 500 mg price order amoxicillin online no prescription
http://prednisoned.online/# buy prednisone mexico
Cerebrozen is an excellent liquid ear health supplement purported to relieve tinnitus and improve mental sharpness, among other benefits. The Cerebrozen supplement is made from a combination of natural ingredients, and customers say they have seen results in their hearing, focus, and memory after taking one or two droppers of the liquid solution daily for a week. https://cerebrozen-try.com/
Unlock the incredible potential of Puravive! Supercharge your metabolism and incinerate calories like never before with our unique fusion of 8 exotic components. Bid farewell to those stubborn pounds and welcome a reinvigorated metabolism and boundless vitality. Grab your bottle today and seize this golden opportunity! https://puravive-web.com/
Boostaro is a dietary supplement designed specifically for men who suffer from health issues. https://boostaro-try.com/
amoxicillin 875 mg tablet: amoxil pharmacy – cost of amoxicillin 875 mg
I strongly recommend stay away from this platform. My own encounter with it has been nothing but disappointment along with doubts about deceptive behavior. Be extremely cautious, or alternatively, seek out a trustworthy platform for your needs.
Protoflow is a prostate health supplement featuring a blend of plant extracts, vitamins, minerals, fruit extracts, and more. https://protoflow-web.com/
I urge you to avoid this site. My own encounter with it has been nothing but dismay as well as doubts about fraudulent activities. Be extremely cautious, or even better, seek out a trustworthy site for your needs.
amoxicillin buy online canada: buy amoxicillin 500mg capsules uk – buy amoxicillin 500mg capsules uk
Erectin is a clinically-proven dietary supplement designed to enhance male https://erectin-web.com/
Fast Lean Pro is a herbal supplement that tricks your brain into imagining that you’re fasting and helps you maintain a healthy weight no matter when or what you eat. It offers a novel approach to reducing fat accumulation and promoting long-term weight management. https://fastleanpro-web.com/
Neuro-Thrive is a brain health supplement that claims to promote good memory and thinking skills and better quality sleep. This nootropic supplement achieves its cause with its potent blend of natural compounds and extracts that are proven to be effective in sharpening mental acuity. https://neurothrive-web.com/
where to get doxycycline odering doxycycline 200 mg doxycycline
I urge you steer clear of this platform. My personal experience with it has been nothing but dismay and suspicion of scamming practices. Proceed with extreme caution, or even better, look for a trustworthy service to meet your needs.
I highly advise to avoid this site. The experience I had with it was nothing but frustration along with suspicion of fraudulent activities. Exercise extreme caution, or alternatively, look for an honest platform to meet your needs.
https://prednisoned.online/# 5 prednisone in mexico
AquaPeace is an all-natural nutritional formula that uses a proprietary and potent blend of ingredients and nutrients to improve overall ear and hearing health and alleviate the symptoms of tinnitus. https://aquapeace-web.com
buy amoxicillin 500mg capsules uk: amoxicillin medicine over the counter – medicine amoxicillin 500
Progenifix is designed to help maximize weight loss results using a mixture of natural, science-backed ingredients. The formula also has secondary benefits, including promoting overall wellness and vitality and assisting your immune system. https://progenifix-web.com/
VivoTonic™ is a 11-in-1 vital blood sugar support formula that may improve how the metabolism goes after the calories that consumers eat. https://vivotonic-web.com/
Alpha Tonic is a powder-based supplement that uses multiple natural herbs and essential vitamins and minerals to help optimize your body’s natural testosterone levels. https://alphatonic-web.com
GlucoFlush is an advanced formula specially designed for pancreas support that will let you promote healthy weight by effectively maintaining the blood sugar level and cleansing and strengthening your gut. https://glucoflush-us.com/
PureLumin Essence is a meticulously-crafted natural formula designed to help women improve the appearance of age spots. https://pureluminessence-web.com/
Sugar Balance is an ultra-potent blood sugar supplement that you can use to help control glucose levels, melt away fat and improve your overall health. https://sugarbalance-us.com/
I highly advise to avoid this platform. The experience I had with it was only dismay as well as concerns regarding deceptive behavior. Be extremely cautious, or even better, find an honest site for your needs.
Dentitox Pro is a liquid dietary solution created as a serum to support healthy gums and teeth. Dentitox Pro formula is made in the best natural way with unique, powerful botanical ingredients that can support healthy teeth. https://dentitox-us.com/
gabapentin 300 neurontin 600 neurontin 400 mg capsule
DuoTrim is an innovative weight loss supplement that utilizes the power of natural plants and nutrients to create CSM bacteria https://duotrim-us.com/