目录
包管理工具
当我们需要使用别人开发的库时,可能会需要去下载其源码然后编译再引入我们的项目,这样做的话一来引用的库多了比较麻烦,而且需要自己管理这些包,二来一旦迁移到其他机子上就得复制过去或是再下载编译一次,尤其对跨平台项目来说简直苦不堪言,因此会有包管理工具的出现。
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就成功了
п»їbest mexican online pharmacies: mexican northern doctors – п»їbest mexican online pharmacies
https://northern-doctors.org/# mexico pharmacies prescription drugs
Respect to post author, some fantastic information .
dance shoes that are shiny are the most cool stuff that you could possibly wear,
mexican rx online mexican northern doctors mexico drug stores pharmacies
reputable mexican pharmacies online: northern doctors pharmacy – mexican pharmaceuticals online
https://northern-doctors.org/# mexico drug stores pharmacies
buying prescription drugs in mexico: mexican pharmacy northern doctors – mexican online pharmacies prescription drugs
I precisely had to thank you so much once again. I’m not certain the things I could possibly have implemented in the absence of the actual smart ideas revealed by you directly on such a industry. This has been an absolute distressing condition in my opinion, however , encountering a new specialized fashion you managed the issue forced me to cry over joy. Now i am happy for the assistance and hope that you find out what a powerful job you happen to be accomplishing teaching people via your blog. Probably you haven’t encountered any of us.
Great post, you have pointed out some great points , I also think this s a very excellent website.
https://northern-doctors.org/# mexican border pharmacies shipping to usa
Duties of property management include accepting rent, responding to and addressing maintenance issues, “
I am curious to find out what blog platform you are working with? I’m having some minor security issues with my latest website and I would like to find something more safeguarded. Do you have any suggestions?
Je pourrais vous en transférer les adresses pour plus de picto en relation avec cette question. Ecrivez moi par mail.
Dziękuję za podkreślenie znaczenia bezpieczeństwa w SEO.
Pin-up Giris: Pin Up Azerbaycan – Pin-Up Casino
슈가 러쉬
Zhu Houzhao는 전혀 두렵지 않고 두렵지 않으며 모든 사람의 마음이 안정됩니다.
https://autolux-azerbaijan.com/# Pin Up
Dziękuję za szczegółowe wyjaśnienia dotyczące strategii SEO.
https://autolux-azerbaijan.com/# Pin-Up Casino
To uspokajające wiedzieć, że są bezpieczne sposoby na SEO.
Pin-Up Casino: pin-up360 – Pin-Up Casino
https://autolux-azerbaijan.com/# Pin Up Azerbaycan
pin-up 141 casino: Pin-Up Casino – Pin-Up Casino
Cieszę się, że znalazłem blog, który tak dokładnie omawia SEO. Dzięki!
Pin-up Giris: Pin Up – ?Onlayn Kazino
https://autolux-azerbaijan.com/# Pin-up Giris
Pin-Up Casino: Pin-up Giris – Pin up 306 casino
To była otwierająca oczy lektura na temat ryzyk i procesu SEO.
https://autolux-azerbaijan.com/# pin-up 141 casino
Ten blog bardzo mi pomógł w zrozumieniu potrzeby SEO.
Good site you have here.. It’s hard to find good quality writing like yours these days. I really appreciate people like you! Take care!!
Hiya! I randomly stumbled upon your blog from Bing. Your article is filled with interesting information, and I will definitely use it at some point in my career. Keep up the excellent work!
에그벳 도메인
즉, 사고가 났을 때 생명을 구할 수 있는지 여부는 전적으로 하나님의 뜻에 달려 있습니다.
Can I simply just say what a comfort to uncover someone that genuinely knows what they are talking about on the internet. You definitely understand how to bring a problem to light and make it important. More people need to check this out and understand this side of your story. I was surprised that you are not more popular given that you certainly possess the gift.
Hmm. just what you mean. Hello, would you eventually have Feed? I’m attempting to sign up in order to get revisions. Tell me.
What¡¦s Going down i am new to this, I stumbled upon this I’ve discovered It absolutely useful and it has helped me out loads. I am hoping to give a contribution & aid other users like its helped me. Great job.
Головоломка 2
I’m just commenting to let you know of the impressive experience my friend’s girl gained browsing your blog. She noticed lots of things, most notably what it’s like to have a marvelous coaching character to let a number of people without hassle understand several tricky subject areas. You really exceeded our expected results. I appreciate you for coming up with such practical, dependable, educational and as well as fun guidance on your topic to Evelyn.
I do enjoy the way you have framed this problem and it does give us some fodder for thought. However, coming from what precisely I have seen, I only trust as the reviews stack on that people today continue to be on point and in no way embark on a tirade associated with the news of the day. Yet, thank you for this superb piece and though I can not necessarily concur with it in totality, I regard the viewpoint.
I used to be able to find good advice from your content.
both basketball and football are sports that are very close to my heart. i love them both but football is my passion..
I’m excited to find this page. I wanted to thank you for your time due to this wonderful read!! I definitely appreciated every bit of it and i also have you bookmarked to look at new things in your website.
Thank you for taking the time to discuss the idea, I find myself intently with it and additionally real love looking at more about this kind of theme. In the event capability, mainly because you arrive at mastery, on earth do you insights upgrading your primary webpage utilizing indepth important info? This is useful for all of us.
Hi there! Do you know if they make any plugins to safeguard against hackers? I’m kinda paranoid about losing everything I’ve worked hard on. Any recommendations?
Hi there, beautiful site with great informational content. This is a really interesting and informative post.
Hi, I’ve suffered with a hearing problem all my life and using the web to talk to people has changed my life, I enjoy many blogs and plan to start my own in the near future. I found your site from a post I read, I though I’d take a look and I’m happy I did.
Your style is really unique compared to other people I have read stuff from. I appreciate you for posting when you have the opportunity, Guess I’ll just bookmark this page.
geinoutime.com
유일한 설명은 누군가 날아가는 공에 도끼를 떨어뜨린 다음…
Здесь вы найдете разнообразный видео контент ялта интурист новый