{"id":4573,"date":"2019-11-30T16:25:43","date_gmt":"2019-11-30T08:25:43","guid":{"rendered":"https:\/\/www.xttblog.com\/?p=4573"},"modified":"2019-11-30T16:25:43","modified_gmt":"2019-11-30T08:25:43","slug":"mac-%e4%b8%8b-protobuf-%e7%9a%84%e5%ae%89%e8%a3%85%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=4573","title":{"rendered":"Mac \u4e0b ProtoBuf \u7684\u5b89\u88c5\u6559\u7a0b"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Mac \u4e0b\u7684\u8f6f\u4ef6\u5b89\u88c5\u5176\u5b9e\u975e\u5e38\u7684\u7b80\u5355\u3002\u524d\u63d0\u662f\u4f60\u5b89\u88c5 Homebrew\uff0c\u4eca\u5929\u5c31\u6709\u4e00\u4e2a\u65b0\u624b Mac \u7528\u6237\u95ee\u6211\u5982\u4f55\u5b89\u88c5 ProtoBuf\uff0c\u8fd9\u91cc\u6211\u5f55\u5236\u4e86\u4e00\u4e2a\u5c0f\u7684\u89c6\u9891\u6559\u7a0b\u548c\u5199\u4e86\u8fd9\u7bc7\u6587\u7ae0\uff0c\u65b9\u4fbf\u5927\u5bb6\u5728 Mac \u4e0b\u5b89\u88c5 ProtoBuf\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b89\u88c5\u4e4b\u524d\uff0c\u6211\u4eec\u53ef\u4ee5\u5148\u4f7f\u7528 brew info protobuf \u547d\u4ee4\u67e5\u770b\u53ef\u4ee5\u5b89\u88c5\u7684 protobuf \u7684\u7248\u672c\u4fe1\u606f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u67e5\u770bprotobuf\u4fe1\u606f\nbrew info protobuf\n# \u5b89\u88c5\nbrew install protobuf@3.7<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/wx2.sinaimg.cn\/mw690\/8fa5dcfcly1g9g4x5qgt4j20wu0f2thj.jpg\" alt=\"\" \/><figcaption>Mac \u4e0b protobuf \u7684\u5b89\u88c5<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u4ee5\u770b\u5230\uff0c\u6267\u884c brew install protobuf \u547d\u4ee4\u5b89\u88c5\u7684\u65f6\u5019\uff0c\u5b83\u5176\u5b9e\u8fd8\u662f\u4ece github \u4e0b\u8f7d\u4e86\u4e00\u4e2a\u8f6f\u4ef6\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b89\u88c5\u7684\u8fc7\u7a0b\u53ef\u80fd\u6bd4\u8f83\u6162\uff0c\u8981\u8010\u5fc3\u7b49\u5f85\u3002\u5982\u679c\u9047\u5230\u5931\u8d25\uff0c\u53ef\u80fd\u662f\u7f51\u7edc\u7684\u539f\u56e0\uff0c\u591a\u91cd\u8bd5\u51e0\u6b21\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u6267\u884c protoc &#8211;version \u547d\u4ee4\uff0c\u67e5\u770b\u5b89\u88c5\u7684\u7248\u672c\u4fe1\u606f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u51fa\u73b0\u201clibprotoc 3.7.1\u201d\u7b49\u4fe1\u606f\uff0c\u5219\u8868\u660e\u5b89\u88c5\u6210\u529f\uff01<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u9700\u8981\u5b89\u88c5\u6700\u65b0\u7684\u7248\u672c\uff0c\u5219\u53ef\u4ee5\u901a\u8fc7 github \u7684\u5730\u5740\uff1ahttps:\/\/github.com\/google\/protobuf \u4e0b\u8f7d\u6e90\u7801\u5305\uff0c\u7136\u540e\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u8fdb\u884c\u7f16\u8bd1\u5b89\u88c5\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew install automake\nbrew install libtool\n# \u6ca1\u6709\u8fd9\u4e24\u4e2a\u5c31\u5b89\u88c5\n.\/autogen.sh\n# \u68c0\u67e5\u6ca1\u95ee\u9898\u4e86\n.\/configure\nmake -j4\nmake check\nmake install\n#\u68c0\u67e5\u5b89\u88c5\u7ed3\u679c\nprotoc  --version<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5176\u4ed6 Mac \u4e0b\u7684\u8f6f\u4ef6\u5b89\u88c5\u4e5f\u7c7b\u4f3c\u3002<\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=4573\">Mac \u4e0b ProtoBuf \u7684\u5b89\u88c5\u6559\u7a0b<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>Mac \u4e0b\u7684\u8f6f\u4ef6\u5b89\u88c5\u5176\u5b9e\u975e\u5e38\u7684\u7b80\u5355\u3002\u524d\u63d0\u662f\u4f60\u5b89\u88c5 Homebrew\uff0c\u4eca\u5929\u5c31\u6709\u4e00\u4e2a\u65b0\u624b Mac \u7528\u6237\u95ee\u6211\u5982\u4f55\u5b89\u88c5 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[1970,1437,1654,1969,1517],"class_list":["post-4573","post","type-post","status-publish","format-standard","hentry","category-java","tag-brew","tag-github","tag-go","tag-homebrew","tag-protobuf"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4573","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4573"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4573\/revisions"}],"predecessor-version":[{"id":4574,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4573\/revisions\/4574"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}