目录
包管理工具
当我们需要使用别人开发的库时,可能会需要去下载其源码然后编译再引入我们的项目,这样做的话一来引用的库多了比较麻烦,而且需要自己管理这些包,二来一旦迁移到其他机子上就得复制过去或是再下载编译一次,尤其对跨平台项目来说简直苦不堪言,因此会有包管理工具的出现。
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就成功了
I highly advise to avoid this site. My personal experience with it was nothing but disappointment as well as suspicion of fraudulent activities. Proceed with extreme caution, or alternatively, find a trustworthy service to fulfill your requirements.
I urge you to avoid this site. My personal experience with it has been purely frustration as well as doubts about deceptive behavior. Be extremely cautious, or better yet, find a trustworthy site for your needs.
I highly advise stay away from this site. The experience I had with it has been nothing but dismay along with suspicion of scamming practices. Proceed with extreme caution, or alternatively, look for a more reputable site to meet your needs.
I highly advise steer clear of this platform. My personal experience with it was only dismay as well as suspicion of scamming practices. Exercise extreme caution, or alternatively, look for an honest platform for your needs.
I strongly recommend to avoid this site. The experience I had with it was only dismay as well as concerns regarding deceptive behavior. Proceed with extreme caution, or alternatively, look for a trustworthy platform to meet your needs.
I highly advise steer clear of this platform. The experience I had with it has been only dismay as well as doubts about scamming practices. Proceed with extreme caution, or even better, find a trustworthy platform to meet your needs.
I highly advise to avoid this platform. My personal experience with it has been nothing but disappointment and doubts about scamming practices. Be extremely cautious, or even better, seek out a more reputable platform for your needs.
I strongly recommend steer clear of this site. My own encounter with it was nothing but frustration along with concerns regarding deceptive behavior. Be extremely cautious, or alternatively, look for a more reputable platform to fulfill your requirements.
Wow, awesome blog format! How lengthy have you ever been blogging for?
you make running a blog glance easy. The entire look of your web site
is wonderful, let alone the content! You can see similar here
dobry sklep
I highly advise stay away from this site. My own encounter with it was purely frustration and doubts about deceptive behavior. Proceed with extreme caution, or even better, seek out a trustworthy site for your needs.
I strongly recommend stay away from this platform. My personal experience with it has been purely disappointment as well as doubts about scamming practices. Be extremely cautious, or better yet, find a trustworthy platform to fulfill your requirements.
I strongly recommend steer clear of this site. My personal experience with it has been nothing but disappointment and suspicion of scamming practices. Proceed with extreme caution, or even better, seek out an honest service to meet your needs.
I strongly recommend steer clear of this site. My personal experience with it was purely dismay as well as doubts about fraudulent activities. Exercise extreme caution, or better yet, find an honest platform to fulfill your requirements.
I strongly recommend stay away from this site. My personal experience with it was only frustration as well as concerns regarding scamming practices. Be extremely cautious, or better yet, look for a more reputable service to meet your needs.
I strongly recommend to avoid this site. The experience I had with it has been only frustration along with doubts about deceptive behavior. Proceed with extreme caution, or better yet, find a trustworthy service to fulfill your requirements.
I urge you to avoid this platform. The experience I had with it has been purely frustration as well as concerns regarding deceptive behavior. Be extremely cautious, or better yet, look for an honest service to meet your needs.
I urge you steer clear of this site. The experience I had with it has been nothing but dismay as well as doubts about deceptive behavior. Proceed with extreme caution, or even better, find a more reputable site to fulfill your requirements.
I strongly recommend to avoid this site. The experience I had with it has been purely dismay along with suspicion of deceptive behavior. Be extremely cautious, or even better, seek out a trustworthy service for your needs.
I urge you to avoid this platform. The experience I had with it has been purely dismay as well as doubts about scamming practices. Proceed with extreme caution, or better yet, seek out a trustworthy site to meet your needs.
I strongly recommend steer clear of this platform. The experience I had with it has been only disappointment and doubts about scamming practices. Exercise extreme caution, or alternatively, find a more reputable service for your needs.
I urge you steer clear of this platform. My personal experience with it has been nothing but dismay and concerns regarding fraudulent activities. Exercise extreme caution, or alternatively, find an honest site to meet your needs.
I strongly recommend stay away from this site. The experience I had with it has been nothing but frustration as well as doubts about deceptive behavior. Be extremely cautious, or even better, find a trustworthy platform to fulfill your requirements.
Incredible! I just finished reading your article and I’m blown away. Your perspective on this subject is incredibly insightful. I’ve gained a new perspective and can’t wait to see what you write next. Keep up the great work!
Amazing! I just finished reading your article and I’m absolutely amazed. Your analysis on the topic is incredibly insightful. I’ve gained a new perspective and can’t wait to see what you write next. Keep up the great work!
Wow! I just read your blog post and I’m absolutely amazed. Your insight on this subject is incredibly insightful. It really made me think and can’t wait to see what you write next. Keep up the great work!
lost money
lost money
lost money
Fantastic! I just finished reading your blog post and I’m blown away. Your insight on this subject is incredibly insightful. I’ve gained a new perspective and can’t wait to see what you write next. Thanks for sharing!
Wow! I just read your post and I’m blown away. Your analysis on the topic is extremely valuable. I’ve gained a new perspective and can’t wait to see what you write next. Your work is inspiring!
lost money
Wow! I recently read your post and I’m thoroughly impressed. Your analysis on this topic is incredibly insightful. I’ve gained a new perspective and can’t wait to see your next post. Thanks for sharing!
phising
lost money
scam
scam
lost money
scam
Wow! I just read your blog post and I’m absolutely amazed. Your insight on this topic is spot-on. It really made me think and can’t wait to read more. Your work is inspiring!
lost money
phising
phising
scam
Hey there! Do you know if they make any plugins to assist with SEO?
I’m trying to get my site to rank for some targeted keywords but I’m not
seeing very good results. If you know of any please share. Thank you!
I saw similar art here: Backlink Portfolio
types of lake boats https://medium.com/@bouchardju35/types-of-lake-boats-a-detailed-guide-2f1a2b47fb84
liveaboard boats https://medium.com/@bouchardju35/best-liveaboard-boats-ultimate-guide-f660fbcda253
sleeping on a boat https://medium.com/@bouchardju35/sleeping-on-a-boat-how-to-prepare-7a0f85c103be
best bass boat brands https://twitter.com/bassboat_
most expensive yachts https://twitter.com/expensiveyacht
bowrider boat brands https://medium.com/@bouchardju35/best-bowrider-boat-brands-to-buy-07cd408789f7