{"id":1611,"date":"2018-08-14T15:03:49","date_gmt":"2018-08-14T07:03:49","guid":{"rendered":"https:\/\/damogame.cn:15443\/wordpress\/?p=1611"},"modified":"2018-08-14T15:03:49","modified_gmt":"2018-08-14T07:03:49","slug":"%e5%88%a9%e7%94%a8vcpkg%e8%bd%bb%e6%9d%be%e9%9b%86%e6%88%90%e5%bc%80%e6%ba%90%e7%ac%ac%e4%b8%89%e6%96%b9%e5%ba%93","status":"publish","type":"post","link":"https:\/\/i007.cc\/wordpress\/archives\/1611","title":{"rendered":"\u5229\u7528Vcpkg\u8f7b\u677e\u96c6\u6210\u5f00\u6e90\u7b2c\u4e09\u65b9\u5e93"},"content":{"rendered":"<div class=\"article-header-box\">\n<div class=\"article-header\">\n<div class=\"article-title-box\">\n<h1 class=\"title-article\">Visual Studio\u5f00\u6e90\u5e93\u96c6\u6210\u5668Vcpkg\u5168\u6559\u7a0b&#8211;\u5229\u7528Vcpkg\u8f7b\u677e\u96c6\u6210\u5f00\u6e90\u7b2c\u4e09\u65b9\u5e93<\/h1>\n<\/div>\n<div class=\"article-info-box\">\n<div class=\"article-bar-top d-flex\"><span class=\"time\">2018\u5e7402\u670808\u65e5 09:57:35<\/span><\/p>\n<div class=\"float-right\"><span class=\"read-count\">\u9605\u8bfb\u6570\uff1a3250<\/span><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<article>\n<div id=\"article_content\" class=\"article_content clearfix csdn-tracking-statistics\" data-pid=\"blog\" data-mod=\"popu_307\" data-dsm=\"post\">\n<div class=\"markdown_views\">\n<h1 id=\"\u5229\u7528vcpkg\u8f7b\u677e\u96c6\u6210\u5f00\u6e90\u7b2c\u4e09\u65b9\u5e93\"><a name=\"t0\"><\/a>\u5229\u7528Vcpkg\u8f7b\u677e\u96c6\u6210\u5f00\u6e90\u7b2c\u4e09\u65b9\u5e93<\/h1>\n<ul>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#1-%E4%B8%BA%E4%BB%80%E4%B9%88%E8%A6%81%E7%94%A8vcpkg\" target=\"_self\" rel=\"nofollow\">1. \u4e3a\u4ec0\u4e48\u8981\u7528Vcpkg<\/a>\n<ul>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#11-%E4%BC%A0%E7%BB%9F%E4%BD%BF%E7%94%A8%E5%BC%80%E6%BA%90%E5%BA%93%E7%9A%84%E6%96%B9%E6%B3%95\" target=\"_self\" rel=\"nofollow\">1.1. \u4f20\u7edf\u4f7f\u7528\u5f00\u6e90\u5e93\u7684\u65b9\u6cd5<\/a>\n<ul>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#111-%E7%BC%96%E8%AF%91%E5%B7%A5%E5%85%B7\" target=\"_self\" rel=\"nofollow\">1.1.1. \u7f16\u8bd1\u5de5\u5177<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#112-%E7%BC%96%E8%AF%91%E7%B1%BB%E5%9E%8B\" target=\"_self\" rel=\"nofollow\">1.1.2. \u7f16\u8bd1\u7c7b\u578b<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#113-%E5%B7%A5%E7%A8%8B%E7%9B%AE%E5%BD%95%E8%AE%BE%E5%AE%9A\" target=\"_self\" rel=\"nofollow\">1.1.3. \u5de5\u7a0b\u76ee\u5f55\u8bbe\u5b9a<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#12-vcpkg%E7%9A%84%E4%BC%98%E7%82%B9\" target=\"_self\" rel=\"nofollow\">1.2. Vcpkg\u7684\u4f18\u70b9<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#2-%E8%8E%B7%E5%8F%96vcpkg\" target=\"_self\" rel=\"nofollow\">2. \u83b7\u53d6Vcpkg<\/a>\n<ul>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#21-%E4%B8%8B%E8%BD%BDvcpkg\" target=\"_self\" rel=\"nofollow\">2.1. \u4e0b\u8f7dVcpkg<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#22-%E7%BC%96%E8%AF%91vcpkg\" target=\"_self\" rel=\"nofollow\">2.2. \u7f16\u8bd1Vcpkg<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#3-%E4%BD%BF%E7%94%A8vcpkg\" target=\"_self\" rel=\"nofollow\">3. \u4f7f\u7528Vcpkg<\/a>\n<ul>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#31-%E6%9F%A5%E7%9C%8Bvcpkg%E6%94%AF%E6%8C%81%E7%9A%84%E5%BC%80%E6%BA%90%E5%BA%93%E5%88%97%E8%A1%A8\" target=\"_self\" rel=\"nofollow\">3.1. \u67e5\u770bVcpkg\u652f\u6301\u7684\u5f00\u6e90\u5e93\u5217\u8868<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#32-%E5%AE%89%E8%A3%85%E4%B8%80%E4%B8%AA%E5%BC%80%E6%BA%90%E5%BA%93\" target=\"_self\" rel=\"nofollow\">3.2. \u5b89\u88c5\u4e00\u4e2a\u5f00\u6e90\u5e93<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#33-%E6%8C%87%E5%AE%9A%E7%BC%96%E8%AF%91%E6%9F%90%E7%A7%8D%E6%9E%B6%E6%9E%84%E7%9A%84%E7%A8%8B%E5%BA%8F%E5%BA%93\" target=\"_self\" rel=\"nofollow\">3.3. \u6307\u5b9a\u7f16\u8bd1\u67d0\u79cd\u67b6\u6784\u7684\u7a0b\u5e8f\u5e93<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#34-%E7%A7%BB%E9%99%A4%E4%B8%80%E4%B8%AA%E5%B7%B2%E7%BB%8F%E5%AE%89%E8%A3%85%E7%BC%96%E8%AF%91%E7%9A%84%E5%BC%80%E6%BA%90%E5%BA%93\" target=\"_self\" rel=\"nofollow\">3.4. \u79fb\u9664\u4e00\u4e2a\u5df2\u7ecf\u5b89\u88c5\uff08\u7f16\u8bd1\uff09\u7684\u5f00\u6e90\u5e93<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#35-%E5%88%97%E5%87%BA%E5%B7%B2%E7%BB%8F%E5%AE%89%E8%A3%85%E7%9A%84%E5%BC%80%E6%BA%90%E5%BA%93\" target=\"_self\" rel=\"nofollow\">3.5. \u5217\u51fa\u5df2\u7ecf\u5b89\u88c5\u7684\u5f00\u6e90\u5e93<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#36-%E6%9B%B4%E6%96%B0%E5%B7%B2%E7%BB%8F%E5%AE%89%E8%A3%85%E7%9A%84%E5%BC%80%E6%BA%90%E5%BA%93\" target=\"_self\" rel=\"nofollow\">3.6. \u66f4\u65b0\u5df2\u7ecf\u5b89\u88c5\u7684\u5f00\u6e90\u5e93<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#37-%E5%AF%BC%E5%87%BA%E5%B7%B2%E7%BB%8F%E5%AE%89%E8%A3%85%E7%9A%84%E5%BC%80%E6%BA%90%E5%BA%93\" target=\"_self\" rel=\"nofollow\">3.7. \u5bfc\u51fa\u5df2\u7ecf\u5b89\u88c5\u7684\u5f00\u6e90\u5e93<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#38-%E5%AF%BC%E5%85%A5%E5%A4%87%E4%BB%BD%E7%9A%84%E5%BC%80%E6%BA%90%E5%BA%93\" target=\"_self\" rel=\"nofollow\">3.8. \u5bfc\u5165\u5907\u4efd\u7684\u5f00\u6e90\u5e93<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#4-vcpkg%E5%92%8Cvisual-studio%E7%9A%84%E9%9B%86%E6%88%90\" target=\"_self\" rel=\"nofollow\">4. Vcpkg\u548cVisual Studio\u7684\u96c6\u6210<\/a>\n<ul>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#41-%E4%BB%80%E4%B9%88%E6%98%AF%E9%9B%86%E6%88%90\" target=\"_self\" rel=\"nofollow\">4.1. \u4ec0\u4e48\u662f\u96c6\u6210\uff1f<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#42-%E9%9B%86%E6%88%90%E5%88%B0%E5%85%A8%E5%B1%80\" target=\"_self\" rel=\"nofollow\">4.2. \u96c6\u6210\u5230\u5168\u5c40<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#43-%E7%A7%BB%E9%99%A4%E5%85%A8%E5%B1%80%E9%9B%86%E6%88%90\" target=\"_self\" rel=\"nofollow\">4.3. \u79fb\u9664\u5168\u5c40\u96c6\u6210<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#44-%E9%9B%86%E6%88%90%E5%88%B0%E5%B7%A5%E7%A8%8B\" target=\"_self\" rel=\"nofollow\">4.4. \u96c6\u6210\u5230\u5de5\u7a0b<\/a>\n<ul>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#441-%E7%94%9F%E6%88%90%E9%85%8D%E7%BD%AE\" target=\"_self\" rel=\"nofollow\">4.4.1. \u751f\u6210\u914d\u7f6e<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#442-%E5%9F%BA%E6%9C%AC%E9%85%8D%E7%BD%AE\" target=\"_self\" rel=\"nofollow\">4.4.2. \u57fa\u672c\u914d\u7f6e<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#443-%E5%B7%A5%E7%A8%8B%E9%85%8D%E7%BD%AE\" target=\"_self\" rel=\"nofollow\">4.4.3. \u5de5\u7a0b\u914d\u7f6e<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#45-%E9%9B%86%E6%88%90%E5%88%B0cmake\" target=\"_self\" rel=\"nofollow\">4.5. \u96c6\u6210\u5230CMake<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#46-%E9%9B%86%E6%88%90%E9%9D%99%E6%80%81%E5%BA%93\" target=\"_self\" rel=\"nofollow\">4.6. \u96c6\u6210\u9759\u6001\u5e93<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#5-%E4%BD%BF%E7%94%A8vcpkg%E6%97%B6%E7%9A%84%E6%B3%A8%E6%84%8F%E7%82%B9\" target=\"_self\" rel=\"nofollow\">5. \u4f7f\u7528Vcpkg\u65f6\u7684\u6ce8\u610f\u70b9<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/cjmqas\/article\/details\/79282847#6-%E5%B0%8F%E7%BB%93\" target=\"_self\" rel=\"nofollow\">6. \u5c0f\u7ed3<\/a><\/li>\n<\/ul>\n<h2 id=\"1-\u4e3a\u4ec0\u4e48\u8981\u7528vcpkg\"><a name=\"t1\"><\/a>1. \u4e3a\u4ec0\u4e48\u8981\u7528Vcpkg<\/h2>\n<h3 id=\"11-\u4f20\u7edf\u4f7f\u7528\u5f00\u6e90\u5e93\u7684\u65b9\u6cd5\"><a name=\"t2\"><\/a>1.1. \u4f20\u7edf\u4f7f\u7528\u5f00\u6e90\u5e93\u7684\u65b9\u6cd5<\/h3>\n<p>Windows\u4e0b\u5f00\u53d1C\/C++\u7a0b\u5e8f\uff0c\u5c11\u4e0d\u4e86\u7f16\u8bd1\u5f00\u6e90\u7684\u7b2c\u4e09\u65b9\u5e93\u3002\u6bd4\u5982\u7528\u4e8e\u7f51\u7edc\u8fde\u63a5\u7684\u9ad8\u6027\u80fd\u5e93libcurl\u3001\u7528\u4e8e\u538b\u7f29\u89e3\u538b\u7684zlib\u7b49\u7b49\u3002\u4f7f\u7528\u8fd9\u4e9b\u5e93\u5f00\u53d1\u6781\u5927\u7684\u65b9\u4fbf\u4e86\u7a0b\u5e8f\u5458\uff0c\u4f7f\u5f97\u6211\u4eec\u4e0d\u5fc5\u91cd\u590d\u9020\u8f6e\u5b50\u3002\u4f46\u662f\u4f7f\u7528\u8fd9\u4e9b\u5e93\u5fc5\u987b\u8981\u5904\u7406\u4ee5\u4e0b\u95ee\u9898\u3002<\/p>\n<h4 id=\"111-\u7f16\u8bd1\u5de5\u5177\">1.1.1. \u7f16\u8bd1\u5de5\u5177<\/h4>\n<p>\u7531\u4e8e\u8fd9\u4e9b\u5f00\u6e90\u5e93\u7edd\u5927\u90e8\u5206\u90fd\u6765\u6e90\u4e8eLinux\u7cfb\u7edf\uff0c\u5bfc\u81f4\u5176\u5de5\u7a0b\u6587\u4ef6\u3001\u7f16\u8bd1\u7cfb\u7edf\u90fd\u4f7f\u7528gnu\u7cfb\u5217\u5de5\u5177\uff0c\u4f7f\u5f97\u5c06\u5176\u79fb\u690d\u5230Windows\u7684VC\u5f00\u53d1\u73af\u5883\u4e0b\u4e00\u76f4\u662f\u96be\u70b9\u3002\u5c3d\u7ba1\u6700\u8fd1\u51e0\u5e74\u5f88\u591a\u5f00\u6e90\u5e93\u90fd\u652f\u6301\u4e86\u8de8\u5e73\u53f0\u7684cmake\uff0c\u4f46\u662f\u7f16\u8bd1\u8fc7\u7a0b\u4ecd\u7136\u590d\u6742\u548c\u591a\u6837\u5316\u3002<\/p>\n<p>\u5e38\u89c1\u7684\u7f16\u8bd1\u65b9\u5f0f\u6709\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u7f16\u8bd1\u65b9\u5f0f<\/th>\n<th>\u7279\u70b9<\/th>\n<th>\u4e3e\u4f8b<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>configure\u3001make<\/td>\n<td>\u9700\u8981msys\u8fd9\u6837\u7684unix\u73af\u5883\u624d\u53ef\u4ee5\u7f16\u8bd1<\/td>\n<td>ffmpeg<\/td>\n<\/tr>\n<tr>\n<td>\u81ea\u5b9a\u4e49\u7f16\u8bd1\u5de5\u5177<\/td>\n<td>\u9700\u8981\u5b66\u4e60\u7279\u5b9a\u7684\u7f16\u8bd1\u547d\u4ee4\u548c\u5de5\u5177<\/td>\n<td>openssl\u3001boost<\/td>\n<\/tr>\n<tr>\n<td>cmake<\/td>\n<td>\u76f8\u5bf9\u7b80\u5355\u8f7b\u677e<\/td>\n<td>libcurl<\/td>\n<\/tr>\n<tr>\n<td>VC\u5de5\u7a0b\u6587\u4ef6<\/td>\n<td>\u8fd9\u79cd\u6700\u7b80\u5355\uff0c\u76f4\u63a5\u62ff\u6765\u5373\u53ef\u7f16\u8bd1<\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4 id=\"112-\u7f16\u8bd1\u7c7b\u578b\">1.1.2. \u7f16\u8bd1\u7c7b\u578b<\/h4>\n<p>\u5f53\u4e86\u89e3\u4e86\u8fd9\u4e9b\u8fd8\u4e0d\u591f\uff0c\u6211\u4eec\u8fd8\u9700\u8981\u8003\u8651\u9884\u5148\u7f16\u8bd1\u51fa\u54ea\u79cd\u7c7b\u578b\u7684\u5f00\u6e90\u5e93\u7a0b\u5e8f\u3002\u6bd4\u5982\uff1aDebug\u8fd8\u662fRelease\u3001\u52a8\u6001\u5e93\u8fd8\u662f\u9759\u6001\u5e93\u3001MD\u8fd8\u662fMT\u300132\u4f4d\u8fd8\u662f64\u4f4d\u3002\u5149\u662f\u8fd9\u4e09\u79cd\u7ec4\u5408\u5c31\u670916\u79cd\u53ef\u80fd\u6027\u3002\u5982\u679c\u50cflibcurl\u8fd9\u79cd\u8fd8\u8981\u8003\u8651\u662f\u5426\u5f15\u7528\u5176\u4ed6\u5f00\u6e90\u5e93\u7684\u529f\u80fd\uff0c\u90a3\u4e48\u7f16\u8bd1\u7c7b\u578b\u7684\u7ec4\u5408\u4f1a\u66f4\u591a\u3002\u7ba1\u7406\u8d77\u6765\u5f88\u9ebb\u70e6\u3002<\/p>\n<h4 id=\"113-\u5de5\u7a0b\u76ee\u5f55\u8bbe\u5b9a\">1.1.3. \u5de5\u7a0b\u76ee\u5f55\u8bbe\u5b9a<\/h4>\n<p>\u7531\u4e8e\u591a\u6837\u7684\u7f16\u8bd1\u7c7b\u578b\uff0c\u5de5\u7a0b\u76ee\u5f55\u4e5f\u5fc5\u987b\u4ed4\u7ec6\u8bbe\u5b9a\u624d\u80fd\u4fdd\u8bc1\u81ea\u5df1\u7684\u8f6f\u4ef6\u9879\u76ee\u80fd\u591f\u6b63\u5e38\u7f16\u8bd1\u3002<\/p>\n<h3 id=\"12-vcpkg\u7684\u4f18\u70b9\"><a name=\"t3\"><\/a>1.2. Vcpkg\u7684\u4f18\u70b9<\/h3>\n<ul>\n<li>\u81ea\u52a8\u4e0b\u8f7d\u5f00\u6e90\u5e93\u6e90\u4ee3\u7801<\/li>\n<li>\u6e90\u7801\u5305\u7684\u7f13\u5b58\u7ba1\u7406\u548c\u7248\u672c\u7ba1\u7406\uff0c\u53ef\u4ee5\u5347\u7ea7\u7248\u672c<\/li>\n<li>\u8f7b\u677e\u7f16\u8bd1<\/li>\n<li>\u4f9d\u8d56\u5173\u7cfb\u68c0\u67e5\uff08\u6bd4\u5982\u7f16\u8bd1libcurl\uff0c\u4f1a\u81ea\u52a8\u4e0b\u8f7dzlib\u3001openssl\u8fdb\u884c\u7f16\u8bd1\uff09<\/li>\n<li>\u65e0\u7f1d\u96c6\u6210Visual Studio\uff0c\u4e0d\u9700\u8981\u8bbe\u7f6e\u5e93\u6587\u4ef6\u3001\u5934\u6587\u4ef6\u7684\u6240\u5728\u76ee\u5f55\uff0c\u81ea\u52a8\u96c6\u6210\u3002<\/li>\n<li>Visual Studio\u5168\u5e73\u53f0\u652f\u6301\uff0c\u4e0d\u4ec5\u652f\u6301Debug\/Release\u3001x86\/x64\u7f16\u8bd1\uff0c\u8fd8\u652f\u6301UWP\u3001ARM\u5e73\u53f0\u7684\u7f16\u8bd1\u3002<\/li>\n<\/ul>\n<h2 id=\"2-\u83b7\u53d6vcpkg\"><a name=\"t4\"><\/a>2. \u83b7\u53d6Vcpkg<\/h2>\n<h3 id=\"21-\u4e0b\u8f7dvcpkg\"><a name=\"t5\"><\/a>2.1. \u4e0b\u8f7dVcpkg<\/h3>\n<p>Vcpkg\u7684\u5b98\u65b9\u6e90\u7801\u7ad9\u70b9\u4e3a\uff1a<\/p>\n<blockquote><p><a href=\"https:\/\/github.com\/microsoft\/vcpkg\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/github.com\/microsoft\/vcpkg<\/a><\/p><\/blockquote>\n<p>\u4e00\u822c\u5730\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528git\u547d\u4ee4\u514b\u9686\u4e00\u4e2a\u5f53\u524d\u7248\u672c\u4e0b\u6765\uff0c\u6216\u8005\u76f4\u63a5\u4e0b\u8f7d\u538b\u7f29\u5305\u3002<\/p>\n<pre class=\"prettyprint\"><code class=\"language-shell hljs php has-numbering\">git <span class=\"hljs-keyword\">clone<\/span> https:<span class=\"hljs-comment\">\/\/github.com\/microsoft\/vcpkg<\/span><\/code><\/pre>\n<ul class=\"pre-numbering\">\n<li>1<\/li>\n<\/ul>\n<h3 id=\"22-\u7f16\u8bd1vcpkg\"><a name=\"t6\"><\/a>2.2. \u7f16\u8bd1Vcpkg<\/h3>\n<p><strong>\u6ce8\u610f\uff1a<\/strong><\/p>\n<blockquote><p>Vcpkg\u5927\u91cf\u4f7f\u7528\u7684psl\u811a\u672c\uff0c\u6240\u4ee5\u5b98\u65b9\u5f3a\u70c8\u63a8\u8350\u4f7f\u7528PowerShell\u800c\u4e0d\u65f6CMD\u547d\u4ee4\u884c\u6765\u6267\u884c\u5404\u79cd\u64cd\u4f5c\u3002\u5c3d\u7ba1\u5728\u4f7f\u7528\u7684\u65f6\u5019\u517c\u5bb9CMD\uff0c\u4f46\u662f\u5728\u7f16\u8bd1\u8fd9\u4e00\u6b65\uff0c\u8bf7\u4f7f\u7528PowerShell\u3002<\/p><\/blockquote>\n<p>\u7f16\u8bd1\u5f88\u7b80\u5355\uff0c\u4f7f\u7528PowerShell\u6267\u884cVcpkg\u5de5\u7a0b\u76ee\u5f55\u4e0b\u7684\u201cbootstrap-vcpkg.bat\u201d\u547d\u4ee4\uff0c\u5373\u53ef\u7f16\u8bd1\u3002\u7f16\u8bd1\u597d\u4ee5\u540e\u4f1a\u5728\u540c\u7ea7\u76ee\u5f55\u4e0b\u751f\u6210vcpkg.exe\u6587\u4ef6\u3002\u7f16\u8bd1\u671f\u95f4\uff0c\u811a\u672c\u4f1a\u81ea\u52a8\u4e0b\u8f7dvswhere\u7ec4\u4ef6\u3002<\/p>\n<h2 id=\"3-\u4f7f\u7528vcpkg\"><a name=\"t7\"><\/a>3. \u4f7f\u7528Vcpkg<\/h2>\n<h3 id=\"31-\u67e5\u770bvcpkg\u652f\u6301\u7684\u5f00\u6e90\u5e93\u5217\u8868\"><a name=\"t8\"><\/a>3.1. \u67e5\u770bVcpkg\u652f\u6301\u7684\u5f00\u6e90\u5e93\u5217\u8868<\/h3>\n<p>\u6267\u884c\u547d\u4ee4<\/p>\n<pre class=\"prettyprint\"><code class=\"language-shell hljs tex has-numbering\">.<span class=\"hljs-command\">\\vcpkg<\/span>.exe search<\/code><\/pre>\n<ul class=\"pre-numbering\">\n<li>1<\/li>\n<\/ul>\n<h3 id=\"32-\u5b89\u88c5\u4e00\u4e2a\u5f00\u6e90\u5e93\"><a name=\"t9\"><\/a>3.2. \u5b89\u88c5\u4e00\u4e2a\u5f00\u6e90\u5e93<\/h3>\n<p>\u8fd9\u91cc\u7684\u201c\u5b89\u88c5\u201d\u5176\u5b9e\u662f\u6307\u4e0b\u8f7d\u548c\u7f16\u8bd1\u3002<\/p>\n<p>\u6bd4\u5982\u6211\u4eec\u9700\u8981\u5b89\u88c5\u5e38\u7528\u7684jsoncpp\u5e93\uff0c\u90a3\u4e48\u6267\u884c\u547d\u4ee4<\/p>\n<pre class=\"prettyprint\"><code class=\"language-shell hljs tex has-numbering\">.<span class=\"hljs-command\">\\vcpkg<\/span>.exe install jsoncpp<\/code><\/pre>\n<ul class=\"pre-numbering\">\n<li>1<\/li>\n<\/ul>\n<p>\u8f93\u51fa\uff1a<\/p>\n<pre class=\"prettyprint\"><code class=\"language-shell hljs haml has-numbering\">The following packages will be built and installed:\r\n    jsoncpp[core]:x86-windows\r\nStarting package 1\/1: jsoncpp:x86-windows\r\nBuilding package jsoncpp[core]:x86-windows...\r\n-<span class=\"ruby\">- <span class=\"hljs-constant\">CURRENT_INSTALLED_DIR<\/span>=<span class=\"hljs-constant\">H<\/span><span class=\"hljs-symbol\">:\/Repos\/vcpkg\/installed\/x86-windows<\/span>\r\n<\/span>-<span class=\"ruby\">- <span class=\"hljs-constant\">DOWNLOADS<\/span>=<span class=\"hljs-constant\">H<\/span><span class=\"hljs-symbol\">:\/Repos\/vcpkg\/downloads<\/span>\r\n<\/span>-<span class=\"ruby\">- <span class=\"hljs-constant\">CURRENT_PACKAGES_DIR<\/span>=<span class=\"hljs-constant\">H<\/span><span class=\"hljs-symbol\">:\/Repos\/vcpkg\/packages\/jsoncpp_x86-windows<\/span>\r\n<\/span>-<span class=\"ruby\">- <span class=\"hljs-constant\">CURRENT_BUILDTREES_DIR<\/span>=<span class=\"hljs-constant\">H<\/span><span class=\"hljs-symbol\">:\/Repos\/vcpkg\/buildtrees\/jsoncpp<\/span>\r\n<\/span>-<span class=\"ruby\">- <span class=\"hljs-constant\">CURRENT_PORT_DIR<\/span>=<span class=\"hljs-constant\">H<\/span><span class=\"hljs-symbol\">:\/Repos\/vcpkg\/ports\/jsoncpp\/<\/span>.\r\n<\/span>-<span class=\"ruby\">- <span class=\"hljs-constant\">Downloading<\/span> <span class=\"hljs-symbol\">https:<\/span>\/<span class=\"hljs-regexp\">\/github.com\/open<\/span>-source-parsers\/jsoncpp\/archive\/<span class=\"hljs-number\">1.8<\/span>.<span class=\"hljs-number\">1<\/span>.tar.gz...\r\n<\/span>-<span class=\"ruby\">- <span class=\"hljs-constant\">Downloading<\/span> <span class=\"hljs-symbol\">https:<\/span>\/<span class=\"hljs-regexp\">\/github.com\/open<\/span>-source-parsers\/jsoncpp\/archive\/<span class=\"hljs-number\">1.8<\/span>.<span class=\"hljs-number\">1<\/span>.tar.gz... <span class=\"hljs-constant\">OK<\/span>\r\n<\/span>-<span class=\"ruby\">- <span class=\"hljs-constant\">Testing<\/span> integrity of downloaded file...\r\n<\/span>-<span class=\"ruby\">- <span class=\"hljs-constant\">Testing<\/span> integrity of downloaded file... <span class=\"hljs-constant\">OK<\/span>\r\n<\/span>-<span class=\"ruby\">- <span class=\"hljs-constant\">Extracting<\/span> source <span class=\"hljs-constant\">H<\/span><span class=\"hljs-symbol\">:\/Repos\/vcpkg\/downloads\/open-source-parsers-jsoncpp-<\/span><span class=\"hljs-number\">1.8<\/span>.<span class=\"hljs-number\">1<\/span>.tar.gz\r\n<\/span>-<span class=\"ruby\">- <span class=\"hljs-constant\">Extracting<\/span> done\r\n<\/span>-<span class=\"ruby\">- <span class=\"hljs-constant\">Configuring<\/span> x86-windows-rel\r\n<\/span>-<span class=\"ruby\">- <span class=\"hljs-constant\">Configuring<\/span> x86-windows-rel done\r\n<\/span>-<span class=\"ruby\">- <span class=\"hljs-constant\">Configuring<\/span> x86-windows-dbg\r\n<\/span>-<span class=\"ruby\">- <span class=\"hljs-constant\">Configuring<\/span> x86-windows-dbg done\r\n<\/span>-<span class=\"ruby\">- <span class=\"hljs-constant\">Build<\/span> x86-windows-rel\r\n<\/span>-<span class=\"ruby\">- <span class=\"hljs-constant\">Build<\/span> x86-windows-rel done\r\n<\/span>-<span class=\"ruby\">- <span class=\"hljs-constant\">Build<\/span> x86-windows-dbg\r\n<\/span>-<span class=\"ruby\">- <span class=\"hljs-constant\">Build<\/span> x86-windows-dbg done\r\n<\/span>-<span class=\"ruby\">- <span class=\"hljs-constant\">Performing<\/span> post-build validation\r\n<\/span>-<span class=\"ruby\">- <span class=\"hljs-constant\">Performing<\/span> post-build validation done\r\n<\/span>Building package jsoncpp[core]:x86-windows... done\r\nInstalling package jsoncpp[core]:x86-windows...\r\nInstalling package jsoncpp[core]:x86-windows... done\r\nElapsed time for package jsoncpp:x86-windows: 47.81 s\r\n\r\nTotal elapsed time: 47.81 s\r\n\r\nThe package jsoncpp:x86-windows provides CMake targets:\r\n\r\n    find_package(jsoncpp REQUIRED)\r\n    target_link_libraries(main PRIVATE jsoncpp_lib)<\/code><\/pre>\n<ul class=\"pre-numbering\">\n<li>1<\/li>\n<li>2<\/li>\n<li>3<\/li>\n<li>4<\/li>\n<li>5<\/li>\n<li>6<\/li>\n<li>7<\/li>\n<li>8<\/li>\n<li>9<\/li>\n<li>10<\/li>\n<li>11<\/li>\n<li>12<\/li>\n<li>13<\/li>\n<li>14<\/li>\n<li>15<\/li>\n<li>16<\/li>\n<li>17<\/li>\n<li>18<\/li>\n<li>19<\/li>\n<li>20<\/li>\n<li>21<\/li>\n<li>22<\/li>\n<li>23<\/li>\n<li>24<\/li>\n<li>25<\/li>\n<li>26<\/li>\n<li>27<\/li>\n<li>28<\/li>\n<li>29<\/li>\n<li>30<\/li>\n<li>31<\/li>\n<li>32<\/li>\n<li>33<\/li>\n<li>34<\/li>\n<li>35<\/li>\n<li>36<\/li>\n<\/ul>\n<p>\u6211\u4eec\u5927\u81f4\u53ef\u4ee5\u4e86\u89e3\u5230install\u4f1a\u7ecf\u5386\u8fd9\u51e0\u4e2a\u8fc7\u7a0b\uff1a<\/p>\n<ol>\n<li>\u73af\u5883\u521d\u59cb\u5316<\/li>\n<li>\u4e0b\u8f7d\u6e90\u4ee3\u7801\uff08\u5982\u679c\u5df2\u7ecf\u5728cache\u4e2d\uff0c\u5219\u4e0d\u4e0b\u8f7d\uff09<\/li>\n<li>\u6821\u9a8c\u6587\u4ef6\u6709\u6548\u6027<\/li>\n<li>\u89e3\u538b\u7f29\u6e90\u4ee3\u7801<\/li>\n<li>\u5229\u7528\u914d\u5957\u5de5\u5177\u914d\u7f6e\u6e90\u7801\u5de5\u7a0b\uff0c\u5728\u8fd9\u91cc\u662f\u4f7f\u7528\u7684\u662fcmake\uff08\u5982\u679c\u662fffmpeg\uff0c\u5219\u7528msys2\uff09<\/li>\n<li>\u7f16\u8bd1\u6e90\u7801\u3002\u4e00\u822c\u4f1a\u540c\u65f6\u7f16\u8bd1Release\u548cDebug\u7248\u672c\u3002<\/li>\n<li>\u628a\u7f16\u8bd1\u597d\u7684\u6587\u4ef6\u62f7\u8d1d\u5230\u76f8\u5173\u76ee\u5f55\u4e2d\u53bb\uff08\u4e00\u822c\u662finstalled\u76ee\u5f55\uff09<\/li>\n<\/ol>\n<p><strong>\u6ce8\u610f\u70b9\uff1a<\/strong><\/p>\n<p>\u5982\u679c\u7535\u8111\u4e2d\u6ca1\u6709\u5b89\u88c5cmake\uff0cvcpkg\u4f1a\u81ea\u52a8\u4e0b\u8f7dportable\u7248\u672c\u7684cmake\u3002\u4f46\u662f\u7531\u4e8e\u5404\u79cd\u539f\u56e0\uff0c\u4e0b\u8f7d\u7684\u7f51\u901f\u5f88\u6162\uff0c\u6240\u4ee5\u5efa\u8bae\u5148\u81ea\u884c\u4e0b\u8f7d\u5b89\u88c5msi\u7248\u672c\u7684cmake\u3002\u6700\u597d\u662f\u4e0b\u8f7d\u6700\u65b0\u7248\u672c\u7684cmake\u3002<\/p>\n<h3 id=\"33-\u6307\u5b9a\u7f16\u8bd1\u67d0\u79cd\u67b6\u6784\u7684\u7a0b\u5e8f\u5e93\"><a name=\"t10\"><\/a>3.3. \u6307\u5b9a\u7f16\u8bd1\u67d0\u79cd\u67b6\u6784\u7684\u7a0b\u5e8f\u5e93<\/h3>\n<p>\u5982\u679c\u4e0d\u6307\u5b9a\u5b89\u88c5\u7684\u67b6\u6784\uff0cvcpkg\u9ed8\u8ba4\u628a\u5f00\u6e90\u5e93\u7f16\u8bd1\u6210x86\u7684Windows\u7248\u672c\u7684\u5e93\u3002\u90a3vcpkg\u603b\u5171\u652f\u6301\u591a\u5c11\u79cd\u67b6\u6784\u5462\uff1f\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u4fbf\u77e5\uff1a<\/p>\n<pre class=\"prettyprint\"><code class=\"language-shell hljs bash has-numbering\">.\\vcpkg.exe <span class=\"hljs-built_in\">help<\/span> triplet<\/code><\/pre>\n<ul class=\"pre-numbering\">\n<li>1<\/li>\n<\/ul>\n<p>\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u4f1a\u5217\u51fa\u5982\u4e0b\u6e05\u5355\uff1a<\/p>\n<ul>\n<li>arm-uwp<\/li>\n<li>arm-windows<\/li>\n<li>arm64-uwp<\/li>\n<li>arm64-windows<\/li>\n<li>x64-uwp<\/li>\n<li>x64-windows-static<\/li>\n<li>x64-windows<\/li>\n<li>x86-uwp<\/li>\n<li>x86-windows-static<\/li>\n<li>x86-windows<\/li>\n<\/ul>\n<p>\u8fd9\u4e2a\u6e05\u5355\u4ee5\u540e\u968f\u7740\u7248\u672c\u7684\u8fed\u4ee3\u8fd8\u4f1a\u518d\u589e\u52a0\u3002vcpkg\u4e0d\u4ec5\u652f\u6301x86\u67b6\u6784\uff0c\u8fd8\u652f\u6301arm\u67b6\u6784\u3002\u6ce8\u610f\uff1a\u8fd9\u91cc\u7684arm\u67b6\u6784\u7279\u6307\u7c7b\u4f3c\u4e8esurface\u8fd9\u79cd\u8fd0\u884c\u5728arm\u5904\u7406\u5668\u4e0a\u7684Win10\u5e73\u53f0\uff0c\u800c\u5e76\u975e\u6211\u4eec\u4f20\u7edf\u610f\u4e49\u4e0a\u7684Linux\u6216android\u7684ARM\u5e73\u53f0\u3002<\/p>\n<p>\u90a3\u5982\u679c\u8981\u5b89\u88c5\u7f16\u8bd1\u67d0\u4e00\u4e2a\u67b6\u6784\u7684\u5f00\u6e90\u5e93\uff0c\u6211\u4eec\u8be5\u600e\u4e48\u5199\u5462\uff1f\u6211\u4eec\u53ea\u9700\u8981\u5728\u9700\u8981\u5b89\u88c5\u7684\u5305\u540e\u9762\u6307\u5b9a\u76f8\u5e94\u7684triplet\u5373\u53ef\u3002\u4f8b\u5982\u6211\u4eec\u9700\u8981\u7f16\u8bd164\u4f4d\u7248\u672c\u7684jsoncpp\uff0c\u90a3\u4e48\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u5373\u53ef\u3002<\/p>\n<pre class=\"prettyprint\"><code class=\"language-shell hljs css has-numbering\">.\\<span class=\"hljs-tag\">vcpkg<\/span><span class=\"hljs-class\">.exe<\/span> <span class=\"hljs-tag\">install<\/span> <span class=\"hljs-tag\">jsoncpp<\/span><span class=\"hljs-pseudo\">:x64-windows<\/span><\/code><\/pre>\n<ul class=\"pre-numbering\">\n<li>1<\/li>\n<\/ul>\n<h3 id=\"34-\u79fb\u9664\u4e00\u4e2a\u5df2\u7ecf\u5b89\u88c5\u7f16\u8bd1\u7684\u5f00\u6e90\u5e93\"><a name=\"t11\"><\/a>3.4. \u79fb\u9664\u4e00\u4e2a\u5df2\u7ecf\u5b89\u88c5\uff08\u7f16\u8bd1\uff09\u7684\u5f00\u6e90\u5e93<\/h3>\n<p>\u5982\u679c\u79fb\u9664\u4e00\u4e2a\u5df2\u7ecf\u5b89\u88c5\u7684\u5f00\u6e90\u5e93\uff0c\u90a3\u4e48\u6267\u884cremove\u6307\u4ee4\u5373\u53ef\u3002\u6bd4\u5982\u6211\u4eec\u8981\u79fb\u9664jsoncpp\uff0c\u90a3\u4e48\u6267\u884c\u547d\u4ee4\uff1a<\/p>\n<pre class=\"prettyprint\"><code class=\"language-shell hljs tex has-numbering\">.<span class=\"hljs-command\">\\vcpkg<\/span>.exe remove jsoncpp<\/code><\/pre>\n<ul class=\"pre-numbering\">\n<li>1<\/li>\n<\/ul>\n<p>\u6ce8\u610f\uff1a<\/p>\n<ul>\n<li>\u8fd9\u4e2a\u65f6\u5019\u53ea\u662f\u79fb\u9664\u4e86\u9ed8\u8ba4\u7684x86-winodws\u7248\u672c\u7684\u6587\u4ef6\uff0c\u5982\u679c\u6709\u5176\u4ed6\u5e73\u53f0\u7684\u7248\u672c\u9700\u8981\u79fb\u9664\uff0c\u9700\u8981\u5236\u5b9a\u76f8\u5e94\u7684triplet\u3002<\/li>\n<li>\u79fb\u9664\u4e5f\u53ea\u662f\u79fb\u9664\u4e86\u4e8c\u8fdb\u5236\u7a0b\u5e8f\u5e93\u800c\u5df2\uff0c\u6e90\u7801\u5305\u548c\u89e3\u538b\u7f29\u7684\u6e90\u7801\u5e76\u6ca1\u6709\u5220\u9664\u3002<\/li>\n<\/ul>\n<p>\u5982\u679c\u60f3\u8981\u4e00\u952e\u79fb\u9664\u201c\u8fc7\u65f6\u201d\u7684\u5305\uff0c\u6267\u884c\u547d\u4ee4\uff1a<\/p>\n<pre class=\"prettyprint\"><code class=\"language-shell hljs brainfuck has-numbering\"><span class=\"hljs-string\">.<\/span><span class=\"hljs-comment\">\\vcpkg<\/span><span class=\"hljs-string\">.<\/span><span class=\"hljs-comment\">exe<\/span> <span class=\"hljs-comment\">remove<\/span> <span class=\"hljs-literal\">-<\/span><span class=\"hljs-literal\">-<\/span><span class=\"hljs-comment\">outdated<\/span><\/code><\/pre>\n<ul class=\"pre-numbering\">\n<li>1<\/li>\n<\/ul>\n<h3 id=\"35-\u5217\u51fa\u5df2\u7ecf\u5b89\u88c5\u7684\u5f00\u6e90\u5e93\"><a name=\"t12\"><\/a>3.5. \u5217\u51fa\u5df2\u7ecf\u5b89\u88c5\u7684\u5f00\u6e90\u5e93<\/h3>\n<p>\u6267\u884clist\u6307\u4ee4\u5373\u53ef\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre class=\"prettyprint\"><code class=\"language-shell hljs php has-numbering\">.\\vcpkg.exe <span class=\"hljs-keyword\">list<\/span><\/code><\/pre>\n<ul class=\"pre-numbering\">\n<li>1<\/li>\n<\/ul>\n<h3 id=\"36-\u66f4\u65b0\u5df2\u7ecf\u5b89\u88c5\u7684\u5f00\u6e90\u5e93\"><a name=\"t13\"><\/a>3.6. \u66f4\u65b0\u5df2\u7ecf\u5b89\u88c5\u7684\u5f00\u6e90\u5e93<\/h3>\n<p>\u4e00\u822c\u6709\u4e24\u79cd\u66f4\u65b0\u65b9\u5f0f\u3002\u4e00\u4e2a\u662fupdate\u6307\u4ee4\uff0c\u53ef\u4ee5\u663e\u793a\u53ef\u4ee5\u5347\u7ea7\u7684\u5f00\u6e90\u5e93\u7684\u5217\u8868\u3002\u53e6\u4e00\u4e2a\u662fupgrade\u7684\u6307\u4ee4\uff0c\u4f1a\u91cd\u65b0\u7f16\u8bd1\u6240\u6709\u9700\u8981\u66f4\u65b0\u7684\u5305\u3002<\/p>\n<h3 id=\"37-\u5bfc\u51fa\u5df2\u7ecf\u5b89\u88c5\u7684\u5f00\u6e90\u5e93\"><a name=\"t14\"><\/a>3.7. \u5bfc\u51fa\u5df2\u7ecf\u5b89\u88c5\u7684\u5f00\u6e90\u5e93<\/h3>\n<p>\u6709\u7684\u65f6\u5019\uff0c\u4e00\u4e2a\u9879\u76ee\u7ec4\u4e2d\u6709\u5f88\u591a\u4eba\uff0c\u4e0d\u9700\u8981\u6bcf\u4e2a\u4eba\u90fd\u53c2\u4e0e\u7f16\u8bd1\u3002\u4e00\u4e2a\u4eba\u7f16\u8bd1\u597d\u6240\u6709\u5f00\u6e90\u5e93\u540e\u5230\u5904\u7ed9\u522b\u4eba\u5373\u53ef\u3002\u6709\u7684\u65f6\u5019\u4e5f\u662f\u51fa\u4e8e\u5907\u4efd\u7684\u76ee\u7684\uff0c\u4e5f\u4f1a\u5bfc\u51fa\u5df2\u7ecf\u5b89\u88c5\u7684\u5f00\u6e90\u5e93\u3002\u5bfc\u51fa\u53ef\u4ee5\u6267\u884cexport\u6307\u4ee4\u3002\u4f8b\u5982\uff0c\u6211\u8981\u5bfc\u51fajsoncpp\u5e93\uff0c\u90a3\u4e48\u6267\u884c\uff1a<\/p>\n<pre class=\"prettyprint\"><code class=\"language-shell hljs haskell has-numbering\">.\\vcpkg.exe <span class=\"hljs-keyword\">export<\/span> jsoncpp <span class=\"hljs-comment\">--7zip<\/span><\/code><\/pre>\n<ul class=\"pre-numbering\">\n<li>1<\/li>\n<\/ul>\n<p>\u6ce8\u610f\uff0c\u5bfc\u51fa\u65f6\u5fc5\u987b\u6307\u5b9a\u5bfc\u51fa\u7684\u5305\u683c\u5f0f\u3002vcpkg\u652f\u63015\u79cd\u5bfc\u51fa\u5305\u683c\u5f0f\uff0c\u6709\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u53c2\u6570<\/th>\n<th>\u683c\u5f0f<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u2013raw<\/td>\n<td>\u4ee5\u4e0d\u6253\u5305\u7684\u76ee\u5f55\u683c\u5f0f\u5bfc\u51fa<\/td>\n<\/tr>\n<tr>\n<td>\u2013nuget<\/td>\n<td>\u4ee5nuget\u5305\u5f62\u5f0f\u5bfc\u51fa<\/td>\n<\/tr>\n<tr>\n<td>\u2013ifw<\/td>\n<td>\u6211\u4e5f\u4e0d\u77e5\u9053\u8fd9\u662f\u5565\u683c\u5f0f<\/td>\n<\/tr>\n<tr>\n<td>\u2013zip<\/td>\n<td>\u4ee5zip\u538b\u7f29\u5305\u5f62\u5f0f\u5bfc\u51fa<\/td>\n<\/tr>\n<tr>\n<td>\u20137zip<\/td>\n<td>\u4ee57z\u538b\u7f29\u5305\u5f62\u5f0f\u5bfc\u51fa<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4e00\u822c\u5730\uff0c\u5bfc\u51fa\u5305\u7684\u683c\u5f0f\u4e3a\uff1avcpkg-export-&lt;\u65e5\u671f&gt;-&lt;\u65f6\u95f4&gt;<\/p>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u53ea\u4f1a\u5bfc\u51fax86-windows\u7684\u5305\uff0c\u5982\u679c\u8981\u5bfc\u51fa\u6240\u6709\u5305\uff0c\u90a3\u9700\u8981\u5236\u5b9a\u76f8\u5e94\u7684triplet\u3002\u6bd4\u5982\uff0c\u5982\u679c\u540c\u65f6\u5bfc\u51fax86\u548cx64\u7248\u672c\u7684jsoncpp\uff0c\u90a3\u6267\u884c\u547d\u4ee4\uff1a<\/p>\n<pre class=\"prettyprint\"><code class=\"language-shell hljs haskell has-numbering\">.\\vcpkg.exe <span class=\"hljs-keyword\">export<\/span> jsoncpp jsoncpp:x64-windows <span class=\"hljs-comment\">--7zip<\/span><\/code><\/pre>\n<ul class=\"pre-numbering\">\n<li>1<\/li>\n<\/ul>\n<p>\u8fd9\u4e2a\u547d\u4ee4\u7b49\u4ef7\u4e8e\uff1a<\/p>\n<pre class=\"prettyprint\"><code class=\"language-shell hljs css has-numbering\">.\\<span class=\"hljs-tag\">vcpkg<\/span><span class=\"hljs-class\">.exe<\/span> <span class=\"hljs-tag\">export<\/span> <span class=\"hljs-tag\">jsoncpp<\/span><span class=\"hljs-pseudo\">:x86-windows<\/span> <span class=\"hljs-tag\">jsoncpp<\/span><span class=\"hljs-pseudo\">:x64-windows<\/span> <span class=\"hljs-tag\">--7zip<\/span><\/code><\/pre>\n<ul class=\"pre-numbering\">\n<li>1<\/li>\n<\/ul>\n<p>\u5982\u679c\u8981\u6307\u5b9a\u8f93\u51fa\u76ee\u5f55\u548c\u7279\u5b9a\u6587\u4ef6\u540d\uff0c\u9700\u4f7f\u7528\u201d\u2013output=\u201d\u53c2\u6570<\/p>\n<h3 id=\"38-\u5bfc\u5165\u5907\u4efd\u7684\u5f00\u6e90\u5e93\"><a name=\"t15\"><\/a>3.8. \u5bfc\u5165\u5907\u4efd\u7684\u5f00\u6e90\u5e93<\/h3>\n<p>\u5bfc\u5165\u6bd4\u8f83\u7b80\u5355\uff0c\u6267\u884cimport\u6307\u4ee4\u5373\u53ef\u3002\u4f8b\u5982\uff1a<\/p>\n<pre class=\"prettyprint\"><code class=\"language-shell hljs java has-numbering\">.\\vcpkg.exe <span class=\"hljs-keyword\">import<\/span> xxx<span class=\"hljs-number\">.7<\/span>z<\/code><\/pre>\n<ul class=\"pre-numbering\">\n<li>1<\/li>\n<\/ul>\n<h2 id=\"4-vcpkg\u548cvisual-studio\u7684\u96c6\u6210\"><a name=\"t16\"><\/a>4. Vcpkg\u548cVisual Studio\u7684\u96c6\u6210<\/h2>\n<h3 id=\"41-\u4ec0\u4e48\u662f\u96c6\u6210\"><a name=\"t17\"><\/a>4.1. \u4ec0\u4e48\u662f\u96c6\u6210\uff1f<\/h3>\n<p>\u4e0a\u9762\u6211\u4eec\u5df2\u7ecf\u5b89\u88c5\u4e86\u4e00\u4e9b\u7b2c\u4e09\u65b9\u5e93\uff0c\u90a3\u5982\u4f55\u4f7f\u7528\u5462\uff1f\u5e38\u89c4\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u9700\u8981\u8bbe\u7f6einclude\u76ee\u5f55\u3001lib\u76ee\u5f55\u7b49\uff0c\u4f1a\u6709\u5f88\u591a\u5de5\u4f5c\u91cf\u3002Vcpkg\u63d0\u4f9b\u4e86\u4e00\u5957\u673a\u5236\uff0c\u53ef\u4ee5\u5168\u81ea\u52a8\u7684\u9002\u914d\u76ee\u5f55\uff0c\u800c\u5f00\u53d1\u8005\u4e0d\u9700\u8981\u5173\u5fc3\u5df2\u5b89\u88c5\u7684\u5e93\u7684\u76ee\u5f55\u5728\u54ea\u91cc\uff0c\u4e5f\u4e0d\u9700\u8981\u8bbe\u7f6e\u3002\u8fd9\u662fVcpkg\u7684\u4e00\u5927\u4f18\u52bf\u3002<\/p>\n<h3 id=\"42-\u96c6\u6210\u5230\u5168\u5c40\"><a name=\"t18\"><\/a>4.2. \u96c6\u6210\u5230\u5168\u5c40<\/h3>\n<p>\u201c\u96c6\u6210\u5230\u5168\u5c40\u201d\u9002\u7528\u4e8eVisual Studio\u5f00\u53d1\u73af\u5883\u548cmsbuild\u547d\u4ee4\u884c\u3002\u6267\u884c\u547d\u4ee4\uff1a<\/p>\n<pre class=\"prettyprint\"><code class=\"language-shell hljs tex has-numbering\"> .<span class=\"hljs-command\">\\vcpkg<\/span> integrate install<\/code><\/pre>\n<ul class=\"pre-numbering\">\n<li>1<\/li>\n<\/ul>\n<p>\u5f53\u51fa\u73b0\u201cApplied user-wide integration for this vcpkg root.\u201d\u5b57\u6837\u7684\u65f6\u5019\uff0c\u8bf4\u660e\u5df2\u7ecf\u96c6\u6210\u6210\u529f\u3002\u8fd9\u65f6\u5019\u53ef\u4ee5\u5728\u4efb\u610f\u7684\u5de5\u7a0b\u4e2d\u4f7f\u7528\u5b89\u88c5\u597d\u7684\u7b2c\u4e09\u65b9\u5e93\u3002<\/p>\n<h3 id=\"43-\u79fb\u9664\u5168\u5c40\u96c6\u6210\"><a name=\"t19\"><\/a>4.3. \u79fb\u9664\u5168\u5c40\u96c6\u6210<\/h3>\n<p>\u79fb\u9664\u5168\u5c40\u96c6\u6210\u53ea\u8981\u6267\u884c\u4e0b\u5217\u547d\u4ee4\u5373\u53ef\uff1a<\/p>\n<pre class=\"prettyprint\"><code class=\"language-shell hljs tex has-numbering\"> .<span class=\"hljs-command\">\\vcpkg<\/span> integrate remove<\/code><\/pre>\n<ul class=\"pre-numbering\">\n<li>1<\/li>\n<\/ul>\n<h3 id=\"44-\u96c6\u6210\u5230\u5de5\u7a0b\"><a name=\"t20\"><\/a>4.4. \u96c6\u6210\u5230\u5de5\u7a0b<\/h3>\n<p>\u4e0a\u9762\u5df2\u7ecf\u53ef\u4ee5\u96c6\u6210\u5230\u5168\u5c40\uff0c\u4e3a\u4ec0\u4e48\u8fd8\u8981\u201c\u96c6\u6210\u5230\u5de5\u7a0b\u201d\u5462\uff1f\u56e0\u4e3a\u5728\u5927\u90e8\u5206\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u4e0d\u5e0c\u671b\u96c6\u6210\u5230\u5168\u5c40\uff0c\u6bd5\u7adf\u6709\u5f88\u591a\u7b2c\u4e09\u65b9\u5e93\u6211\u4eec\u5e0c\u671b\u81ea\u5b9a\u4e49\u5904\u7406\u4e00\u4e0b\uff0c\u6216\u8005\u5e72\u8106\u4e0d\u60f3\u96c6\u6210\u7b2c\u4e09\u65b9\u5e93\u3002\u90a3\u4e48\u96c6\u6210\u5230\u5de5\u7a0b\u662f\u6700\u7075\u6d3b\u7684\u5904\u7406\u65b9\u5f0f\u3002\u4e5f\u662f\u5de5\u7a0b\u7ea7\u9879\u76ee\u63a8\u8350\u7684\u5904\u7406\u65b9\u5f0f\u3002<\/p>\n<p>\u201c\u96c6\u6210\u5230\u5de5\u7a0b\u201d\u662f\u6574\u4e2avcpkg\u4e2d\u6700\u590d\u6742\u7684\u4e00\u9879\uff0c\u5b83\u9700\u8981\u5229\u7528Visual Studio \u4e2d\u7684nuget\u63d2\u4ef6\u6765\u5b9e\u73b0\u3002\u6211\u4eec\u63a5\u4e0b\u6765\u4e00\u6b65\u4e00\u6b65\u6765\u8bf4\u3002<\/p>\n<h4 id=\"441-\u751f\u6210\u914d\u7f6e\">4.4.1. \u751f\u6210\u914d\u7f6e<\/h4>\n<p>\u6267\u884c\u547d\u4ee4<\/p>\n<pre class=\"prettyprint\"><code class=\"language-shell hljs tex has-numbering\"> .<span class=\"hljs-command\">\\vcpkg<\/span> integrate project<\/code><\/pre>\n<ul class=\"pre-numbering\">\n<li>1<\/li>\n<\/ul>\n<p>\u8fd9\u65f6\u5019\u4f1a\u5728\u201c\\scripts\\buildsystems\u201d\u76ee\u5f55\u4e0b\uff0c\u751f\u6210nuget\u914d\u7f6e\u6587\u4ef6.<\/p>\n<p>\u5176\u4e2d\u662f\u6307vcpkg\u5b9e\u9645\u6240\u5728\u76ee\u5f55\u3002<\/p>\n<h4 id=\"442-\u57fa\u672c\u914d\u7f6e\">4.4.2. \u57fa\u672c\u914d\u7f6e<\/h4>\n<p>\u6253\u5f00Visual Studio\uff0c\u70b9\u51fb\u83dc\u5355\u201c\u5de5\u5177-&gt;NuGet\u5305\u7ba1\u7406\u5668-&gt;\u7a0b\u5e8f\u5305\u7ba1\u7406\u5668\u8bbe\u7f6e\u201d\uff0c\u8fdb\u5165\u8bbe\u7f6e\u754c\u9762\uff0c\u70b9\u51fb\u201c\u7a0b\u5e8f\u5305\u6e90\u201d\u3002<\/p>\n<p><img decoding=\"async\" title=\"\" src=\"https:\/\/img-blog.csdn.net\/20180207174748277?watermark\/2\/text\/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvY2ptcWFz\/font\/5a6L5L2T\/fontsize\/400\/fill\/I0JBQkFCMA==\/dissolve\/70\/gravity\/SouthEast\" alt=\"\" \/><br \/>\n\u70b9\u51fb\u201c\u52a0\u53f7\u201d\u589e\u52a0\u4e00\u4e2a\u6e90\u3002\u4fee\u6539\u6e90\u7684\u540d\u5b57\u4e3avcpkg\u3002\u5728\u201c\u6e90\u201d\u7684\u9009\u9879\u4e2d\u70b9\u51fb\u53f3\u4fa7\u7684\u201d\u2026\u201d\u9009\u62e9vcpkg\u76ee\u5f55\u4e0b\u7684\u201cscripts\\buildsystems\u201d\u76ee\u5f55\uff0c\u7136\u540e\u70b9\u51fb\u53f3\u4fa7\u7684\u201c\u66f4\u65b0\u6309\u94ae\u201d\u3002<\/p>\n<p>\u70b9\u51fb\u201c\u786e\u5b9a\u201d\uff0c\u5173\u95ed\u8bbe\u7f6e\u5bf9\u8bdd\u6846\u3002<\/p>\n<p>\u5230\u6b64\uff0c\u5168\u5c40\u6027\u7684\u8bbe\u7f6e\u5df2\u7ecf\u5b8c\u6210\uff0c\u4ee5\u540e\u4e0d\u5fc5\u518d\u91cd\u590d\u8bbe\u7f6e\u4e86\u3002<\/p>\n<h4 id=\"443-\u5de5\u7a0b\u914d\u7f6e\">4.4.3. \u5de5\u7a0b\u914d\u7f6e<\/h4>\n<p>\u7528Visual Studio \u6253\u5f00\u4e00\u4e2a\u5de5\u7a0b\u6216\u89e3\u51b3\u65b9\u6848\u3002\u53f3\u952e\u70b9\u51fb\u9700\u8981\u8bbe\u7f6e\u7684\u5de5\u7a0b\uff0c\u9009\u62e9\u201c\u7ba1\u7406NuGet\u7a0b\u5e8f\u5305\u201d\u3002\u5728\u53f3\u4e0a\u89d2\u7684\u201c\u7a0b\u5e8f\u5305\u6e90\u201d\u4e2d\u9009\u62e9\u521a\u521a\u8bbe\u7f6e\u7684\u201cvcpkg\u201d\u3002\u8fd9\u6837\u5728\u201c\u6d4f\u89c8\u201d\u9009\u9879\u5361\u4e2d\u5c31\u53ef\u4ee5\u770b\u5230\u201cvcpkg.H.Repos.vcpkg\u201d\u3002\u70b9\u51fb\u6700\u53f3\u4fa7\u7684\u201c\u5b89\u88c5\u201d\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u96c6\u6210\u5230\u67d0\u4e2a\u5de5\u7a0b\u4e86\u3002<\/p>\n<p><img decoding=\"async\" title=\"\" src=\"https:\/\/img-blog.csdn.net\/20180207174816048?watermark\/2\/text\/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvY2ptcWFz\/font\/5a6L5L2T\/fontsize\/400\/fill\/I0JBQkFCMA==\/dissolve\/70\/gravity\/SouthEast\" alt=\"\" \/><\/p>\n<p><img decoding=\"async\" title=\"\" src=\"https:\/\/img-blog.csdn.net\/20180207174823320?watermark\/2\/text\/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvY2ptcWFz\/font\/5a6L5L2T\/fontsize\/400\/fill\/I0JBQkFCMA==\/dissolve\/70\/gravity\/SouthEast\" alt=\"\" \/><\/p>\n<h3 id=\"45-\u96c6\u6210\u5230cmake\"><a name=\"t21\"><\/a>4.5. \u96c6\u6210\u5230CMake<\/h3>\n<p>\u6700\u65b0\u7684Visual Studio 2015\u548c2017\u5927\u529b\u652f\u6301CMake\u5de5\u7a0b\uff0c\u6240\u4ee5\u5bf9cmake\u7684\u652f\u6301\u5f53\u7136\u4e0d\u80fd\u5c11\u3002\u5728cmake\u4e2d\u96c6\u6210\u53ea\u8981\u5728cmake\u6587\u4ef6\u4e2d\u52a0\u5165\u4e0b\u9762\u8fd9\u53e5\u8bdd\u5373\u53ef\u3002<\/p>\n<blockquote><p>-DCMAKE_TOOLCHAIN_FILE=\/scripts\/buildsystems\/vcpkg.cmake\u201d<\/p><\/blockquote>\n<p>\u5176\u4e2d\u662f\u6307vcpkg\u5b9e\u9645\u6240\u5728\u76ee\u5f55\u3002<\/p>\n<h3 id=\"46-\u96c6\u6210\u9759\u6001\u5e93\"><a name=\"t22\"><\/a>4.6. \u96c6\u6210\u9759\u6001\u5e93<\/h3>\n<p>Vcpkg\u9ed8\u8ba4\u7f16\u8bd1\u94fe\u63a5\u7684\u662f\u52a8\u6001\u5e93\uff0c\u5982\u679c\u8981\u94fe\u63a5\u9759\u6001\u5e93\uff0c\u76ee\u524d\u8fd8\u6ca1\u6709\u7b80\u4fbf\u7684\u65b9\u6cd5\u3002\u9700\u8981\u505a\u5982\u4e0b\u64cd\u4f5c<\/p>\n<ol>\n<li>\u7528\u6587\u672c\u65b9\u5f0f\u6253\u5f00vcxproj\u5de5\u7a0b\u6587\u4ef6<\/li>\n<li>\u5728xml\u7684\u6bb5\u91cc\u9762\u589e\u52a0\u5982\u4e0b\u4e24\u53e5\u8bdd\u5373\u53ef<\/li>\n<\/ol>\n<pre class=\"prettyprint\"><code class=\"language-xml hljs  has-numbering\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-title\">VcpkgTriplet<\/span>&gt;<\/span>x86-windows-static<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-title\">VcpkgTriplet<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-title\">VcpkgEnabled<\/span>&gt;<\/span>true<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-title\">VcpkgEnabled<\/span>&gt;<\/span><\/code><\/pre>\n<ul class=\"pre-numbering\">\n<li>1<\/li>\n<li>2<\/li>\n<\/ul>\n<p>\u5728CMake\u4e2d\u96c6\u6210\u9759\u6001\u5e93\uff0c\u9700\u8981\u989d\u5916\u6307\u4ee4<\/p>\n<pre class=\"prettyprint\"><code class=\"language-shell hljs r has-numbering\">cmake .. -DCMAKE_TOOLCHAIN_FILE=<span class=\"hljs-keyword\">...<\/span>\/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x86-windows-static<\/code><\/pre>\n<ul class=\"pre-numbering\">\n<li>1<\/li>\n<\/ul>\n<h2 id=\"5-\u4f7f\u7528vcpkg\u65f6\u7684\u6ce8\u610f\u70b9\"><a name=\"t23\"><\/a>5. \u4f7f\u7528Vcpkg\u65f6\u7684\u6ce8\u610f\u70b9<\/h2>\n<ul>\n<li>Vcpkg\u4ec5\u652f\u6301Visual Studio 2015 update 3\u53ca\u4ee5\u4e0a\u7248\u672c\uff08\u5305\u62ecVisual Studio 2017\uff09\uff0c\u7a76\u5176\u539f\u56e0\uff0c\u5f88\u53ef\u80fd\u548cc++11\u7684\u652f\u6301\u5ea6\u4ee5\u53ca\u96c6\u6210\u539f\u7406\u6709\u5173\u7cfb\u3002<\/li>\n<li>\u76ee\u524dVcpkg\u7f16\u8bd1\u9759\u6001\u5e93\uff0c\u9ed8\u8ba4\u53ea\u652f\u6301MT\u6a21\u5f0f\u3002<\/li>\n<\/ul>\n<h2 id=\"6-\u5c0f\u7ed3\"><a name=\"t24\"><\/a>6. \u5c0f\u7ed3<\/h2>\n<p>Vcpkg\u76ee\u524d\u8fd8\u5728\u4e0d\u65ad\u7684\u5b8c\u5584\u4e2d\uff0c\u4f46\u4e0d\u53ef\u5426\u8ba4\uff0c\u5b83\u5df2\u7ecf\u6781\u5927\u7684\u51cf\u5c11\u4e86\u6211\u4eec\u5728\u9879\u76ee\u542f\u52a8\u65f6\uff0c\u51c6\u5907\u7b2c\u4e09\u65b9\u5e93\u7684\u65f6\u95f4\u3002\u63d0\u9ad8\u4e86\u5de5\u4f5c\u6548\u7387\u3002\u6309\u7167\u65f6\u9ae6\u7684\u8bdd\u6765\u8bf4\uff0c\u5c31\u662f\u907f\u514d\u4e86\u91cd\u590d\u9020\u8f6e\u5b50\u3002\u76ee\u524dVcpkg\u5df2\u7ecf\u96c6\u6210\u4e86\u4e0a\u767e\u4e2a\u5e38\u7528\u7684\u5f00\u6e90\u5e93\uff0c\u800c\u4e14\u6570\u91cf\u8fd8\u5728\u4e0d\u505c\u589e\u957f\u3002\u6bd5\u7adf\u662f\u5fae\u8f6f\u65d7\u4e0b\u7684\u5f00\u6e90\u9879\u76ee\uff0c\u8d28\u91cf\u8fd8\u662f\u53ef\u4ee5\u5f97\u5230\u4fdd\u969c\u7684\uff0c\u5b8c\u5168\u53ef\u4ee5\u5728\u5de5\u4e1a\u7ea7\u9879\u76ee\u4e2d\u5f97\u4ee5\u4f7f\u7528\u3002\u6e90\u4ee3\u7801\u6258\u7ba1\u5728github\u4e0a\uff0cgithub\u793e\u533a\u5f88\u6d3b\u8dc3\uff0c\u6709\u5174\u8da3\u7684\u670b\u53cb\u4e5f\u53ef\u4ee5\u53c2\u4e0e\u8fdb\u6765\u3002<\/p>\n<blockquote><p>\u4f5c\u8005\u7b80\u4ecb\uff1a\u9648\u5efa\u660e\uff0c\u76ee\u524d\u5c31\u804c\u4e8e\u4e0a\u6d77\u607a\u82f1\u7f51\u7edc\u79d1\u6280\u6709\u9650\u516c\u53f8\uff0cC++\u4e13\u4e1a\u7ec4\u7ec4\u957f\u3002<\/p><\/blockquote>\n<\/div>\n<\/div>\n<\/article>\n","protected":false},"excerpt":{"rendered":"<p>Visual Studio\u5f00\u6e90\u5e93\u96c6\u6210\u5668V<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[],"tags":[118],"class_list":["post-1611","post","type-post","status-publish","format-standard","hentry","tag-02-"],"_links":{"self":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/1611","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/comments?post=1611"}],"version-history":[{"count":0,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/1611\/revisions"}],"wp:attachment":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/media?parent=1611"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/categories?post=1611"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/tags?post=1611"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}