目录
包管理工具
当我们需要使用别人开发的库时,可能会需要去下载其源码然后编译再引入我们的项目,这样做的话一来引用的库多了比较麻烦,而且需要自己管理这些包,二来一旦迁移到其他机子上就得复制过去或是再下载编译一次,尤其对跨平台项目来说简直苦不堪言,因此会有包管理工具的出现。
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就成功了
apple watch ремонт
Профессиональный сервисный центр по ремонту холодильников и морозильных камер.
Мы предлагаем: ремонт холодильников с выездом
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
ремонт iwatch
This blog was… how do I say it? Relevant!! Finally I’ve found something which helped me. Thanks.
Профессиональный сервисный центр по ремонту планетов в том числе Apple iPad.
Мы предлагаем: срочный ремонт айпада
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
https://sweetbonanza.network/# sweet bonanza giris
https://sweetbonanza.network/# sweet bonanza slot
Falling ferro nickel prices and shrinking slowdown in demand has also resulted price now as well as the shrinking nickel ore demands.
guvenilir slot siteleri: deneme veren slot siteleri – bonus veren slot siteleri
They are going to need your banking information so as to transfer the funds into the checking account.
In almost all businesses you like to enter, it might be best to have a concept about it and terms used within it.
slot bahis siteleri: slot kumar siteleri – en iyi slot siteleri 2024
Профессиональный сервисный центр по ремонту бытовой техники с выездом на дом.
Мы предлагаем:сервис центры бытовой техники петербург
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
Профессиональный сервисный центр по ремонту ноутбуков и компьютеров.дронов.
Мы предлагаем:ремонт ноутбуков москва центр
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
While the objective of AA is to create portfolios with the greatest return for a level of risk, and to optimize individuals’ risk exposure according to their risk tolerance, goals and investment time frame, the objective of AL is to maximize the benefits of different account-types – usually to minimize taxes.
This post was written with t he help of GSA Content Generator Dem oversion.
Understanding the nature of personality disorders is crucial in order to provide appropriate support and effective treatment for individuals living with these conditions.
Great information. Lucky me I discovered your blog by chance (stumbleupon). I’ve saved as a favorite for later.
Профессиональный сервисный центр по ремонту холодильников и морозильных камер.
Мы предлагаем: ремонт холодильников на дому
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
ремонт apple watch
Appreciated this post. It’s highly well-researched and packed with helpful details. Excellent effort!
deneme veren slot siteleri: deneme bonusu veren slot siteleri – en iyi slot siteleri
slot kumar siteleri: slot siteleri – en iyi slot siteler
https://denemebonusuverensiteler.win/# bahis siteleri
https://slotsiteleri.bid/# casino slot siteleri
This post is incredibly informative. I truly enjoyed perusing it. The content is highly structured and straightforward to follow.
en iyi slot siteler: canl? slot siteleri – bonus veren casino slot siteleri
You ought to be a part of a contest for one of the best websites on the web. I am going to recommend this web site!
https://denemebonusuverensiteler.win/# bahis siteleri
https://denemebonusuverensiteler.win/# deneme bonusu
Spot on with this write-up, I truly believe that this amazing site needs far more attention. I’ll probably be returning to see more, thanks for the advice!
You should be a part of a contest for one of the finest sites on the internet. I most certainly will highly recommend this site!
apple сервис центр
With Roosevelt’s affect on the wane following the failure of the Judicial Procedures Reform Invoice of 1937, conservative Democrats joined with Republicans to dam the implementation of additional New Deal regulatory programs.
He led the British Military in battle towards the soldiers whom he had as soon as commanded, and his name turned synonymous with treason and betrayal within the United States.
If there is robust investor demand for an ETF, its share price will temporarily rise above its web asset value per share, giving arbitrageurs an incentive to purchase additional creation items from the ETF issuer and promote the component ETF shares in the open market.
A consumer-pleasing bathroom is considered one of the top house-promoting components, but even an opulent, custom bath can detract if it is too individualistic.
One month later, HP’s official coaching middle was hacked and defaced by a Pakistani hacker often known as Hitcher to show an online vulnerability.
Hello there! This blog post couldn’t be written much better! Looking at this article reminds me of my previous roommate! He always kept talking about this. I will send this post to him. Fairly certain he’s going to have a good read. I appreciate you for sharing!
So an educational article! I picked up plenty from going through it. Your information is extremely well-organized and easy to understand.
Deciding upon the index and then discovering sectors which are of interest is recommended.
Профессиональный сервисный центр по ремонту сотовых телефонов, смартфонов и мобильных устройств.
Мы предлагаем: ремонт телефонов поблизости от меня
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
Профессиональный сервисный центр по ремонту ноутбуков и компьютеров.дронов.
Мы предлагаем:сервисы по ремонту ноутбуков в москве
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
Finally, another commission, CFTC (Commodities Futures Trading Commission), claims that cryptocurrencies are commodities and suggests applying corresponding laws and regulations.
Moreover, the “unauthorized trading” of Kweku Adoboli, similar to Kerviel, did not date back a long way.
Aw, this was a really good post. Spending some time and actual effort to generate a top notch article… but what can I say… I put things off a whole lot and never seem to get nearly anything done.
You may certainly discover ideas that work in the remainder of your closets, too!
Appreciated the information in this post. It’s highly comprehensive and packed with useful insights. Excellent work!
If you are new to the Forex market or successively losing money with your trading account you will need expert advice such as a Forex trading broker who has a solid trading platform backed by automated software meant for the business.
pragmatic play sweet bonanza: guncel sweet bonanza – sweet bonanza demo turkce