{"id":1688,"date":"2018-10-01T09:40:00","date_gmt":"2018-10-01T01:40:00","guid":{"rendered":"https:\/\/damogame.cn:15443\/wordpress\/?p=1688"},"modified":"2018-10-01T09:40:00","modified_gmt":"2018-10-01T01:40:00","slug":"centos-7%e4%b8%8bprotobuf%e7%9a%84%e6%ba%90%e7%a0%81%e7%bc%96%e8%af%91%e5%ae%89%e8%a3%85","status":"publish","type":"post","link":"https:\/\/i007.cc\/wordpress\/archives\/1688","title":{"rendered":"CentOS 7\u4e0bprotobuf\u7684\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5"},"content":{"rendered":"<div id=\"printBody\">\n<div>\n<h1 class=\"aTitle\">CentOS 7\u4e0bprotobuf\u7684\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5<\/h1>\n<\/div>\n<table width=\"97%\" align=\"center\">\n<tbody>\n<tr>\n<td width=\"140\">[\u65e5\u671f\uff1a2016-12-23]<\/td>\n<td align=\"center\">\u6765\u6e90\uff1aLinux\u793e\u533a\u00a0 \u4f5c\u8005\uff1alearn21cn<\/td>\n<td align=\"right\" width=\"160\">[\u5b57\u4f53\uff1a<a>\u5927<\/a>\u00a0<a>\u4e2d<\/a>\u00a0<a>\u5c0f<\/a>]<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div id=\"li_all\">\n<div id=\"li_1\"><\/div>\n<div id=\"li_2\"><\/div>\n<\/div>\n<div id=\"content\">\n<p>protobuf\u7684github\u5730\u5740\uff1ahttps:\/\/github.com\/google\/protobuf\u652f\u6301\u591a\u79cd\u8bed\u8a00\uff0c\u6709\u591a\u4e2a\u8bed\u8a00\u7684\u7248\u672c\uff0c\u672c\u6587\u91c7\u7528\u7684\u662f\u5728<a title=\"CentOS\" href=\"http:\/\/www.linuxidc.com\/topicnews.aspx?tid=14\" target=\"_blank\" rel=\"noopener\">CentOS<\/a>\u00a07\u4e0b\u7f16\u8bd1\u6e90\u7801\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<p>github\u4e0a\u6709\u8be6\u7ec6\u7684\u5b89\u88c5\u8bf4\u660e\uff1ahttps:\/\/github.com\/google\/protobuf\/blob\/master\/src\/README.md<\/p>\n<p>1\u3001\u786e\u5b9acentos7\u4e0a\u5df2\u7ecf\u5b89\u88c5\u4e86\u4e0b\u9762\u7684\u8f6f\u4ef6\uff0c\u6216\u8005\u76f4\u63a5\u7528yum\u8fdb\u884c\u66f4\u65b0<\/p>\n<div class=\"linuxidc_code\">\n<pre>autoconf\r\nautomake\r\nlibtool\r\ncurl (used to download gmock)\r\nmake\r\ng++\r\nunzip<\/pre>\n<\/div>\n<p>2\u3001\u4e0b\u8f7d\u6e90\u7801\u5305\uff0c\u89e3\u538b\uff0c\u7f16\u8bd1\u5b89\u88c5<\/p>\n<p>\u5730\u5740\uff1ahttps:\/\/github.com\/google\/protobuf\/releases<\/p>\n<p>\u9009\u62e9<strong>Source code<\/strong><span class=\"Apple-converted-space\">\u00a0(tar.gz)\u4e0b\u8f7d<\/span><\/p>\n<div class=\"linuxidc_code\">\n<pre>tar -zxvf protobuf-3.1.0.tar.gz -C \/usr\/local\/\r\ncd protobuf-3.1.0\/\r\n# \u5982\u679c\u4f7f\u7528\u7684\u4e0d\u662f\u6e90\u7801\uff0c\u800c\u662frelease\u7248\u672c (\u5df2\u7ecf\u5305\u542bgmock\u548cconfigure\u811a\u672c)\uff0c\u53ef\u4ee5\u7565\u8fc7\u8fd9\u4e00\u6b65\r\n.\/autogen.sh\r\n# \u6307\u5b9a\u5b89\u88c5\u8def\u5f84\r\n.\/configure --prefix=\/usr\/local\/protobuf\r\n#\u7f16\u8bd1\r\nmake\r\n# \u6d4b\u8bd5\uff0c\u8fd9\u4e00\u6b65\u5f88\u8017\u65f6\u95f4\r\nmake check\r\nmake install\r\n# refresh shared library cache.\r\nldconfig<\/pre>\n<\/div>\n<p>\u6ce8\u610fmake check\u8fd9\u4e00\u6b65\u4f1a\u82b1\u8d39\u6bd4\u8f83\u591a\u7684\u65f6\u95f4<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.linuxidc.com\/upload\/2016_12\/161223095268921.png\" alt=\"\" width=\"596\" height=\"258\" \/><\/p>\n<p>3\u3001\u8bbe\u7f6e\u4e00\u4e0b\u73af\u5883\u53d8\u91cf \/etc\/profile<\/p>\n<div class=\"linuxidc_code\">\n<pre># (\u52a8\u6001\u5e93\u641c\u7d22\u8def\u5f84) \u7a0b\u5e8f\u52a0\u8f7d\u8fd0\u884c\u671f\u95f4\u67e5\u627e\u52a8\u6001\u94fe\u63a5\u5e93\u65f6\u6307\u5b9a\u9664\u4e86\u7cfb\u7edf\u9ed8\u8ba4\u8def\u5f84\u4e4b\u5916\u7684\u5176\u4ed6\u8def\u5f84\r\nexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:\/usr\/local\/protobuf\/lib\r\n# (\u9759\u6001\u5e93\u641c\u7d22\u8def\u5f84) \u7a0b\u5e8f\u7f16\u8bd1\u671f\u95f4\u67e5\u627e\u52a8\u6001\u94fe\u63a5\u5e93\u65f6\u6307\u5b9a\u67e5\u627e\u5171\u4eab\u5e93\u7684\u8def\u5f84\r\nexport LIBRARY_PATH=$LIBRARY_PATH:\/usr\/local\/protobuf\/lib\r\n\r\nexport PATH=$PATH:\/usr\/local\/protobuf\/bin<\/pre>\n<\/div>\n<p>4\u3001\u67e5\u770b\u7248\u672c<\/p>\n<div class=\"linuxidc_code\">\n<pre>protoc --version<\/pre>\n<\/div>\n<p>\u4e4b\u540e\uff0c\u5bf9\u4e8e\u76f8\u540c\u7684\u7cfb\u7edf\u73af\u5883\uff0c\u5c31\u4e0d\u9700\u8981\u518d\u7f16\u8bd1\u4e86\uff0c\u76f4\u63a5\u5c06\u7f16\u8bd1\u597d\u7684protobuf\uff08\u76ee\u5f55\uff1a\/usr\/local\/protobuf\uff09\u5206\u53d1\u5230\u5176\u4ed6\u8ba1\u7b97\u673a\uff0c\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u5373\u53ef\u3002<\/p>\n<p><strong>\u672c\u6587\u6c38\u4e45\u66f4\u65b0\u94fe\u63a5\u5730\u5740<\/strong>\uff1a<a href=\"https:\/\/www.linuxidc.com\/Linux\/2016-12\/138716.htm\">http:\/\/www.linuxidc.com\/Linux\/2016-12\/138716.htm<\/a><\/p>\n<p><a href=\"http:\/\/www.linuxidc.com\/\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.linuxidc.com\/linuxfile\/logo.gif\" alt=\"linux\" width=\"15\" height=\"17\" \/><\/a><\/div>\n<div class=\"linux3\"><\/div>\n<div class=\"linux302\"><\/div>\n<\/div>\n<div class=\"linuxfx\"><\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CentOS 7\u4e0bprotobuf\u7684\u6e90\u7801<\/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-1688","post","type-post","status-publish","format-standard","hentry","tag-02-"],"_links":{"self":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/1688","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=1688"}],"version-history":[{"count":0,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/1688\/revisions"}],"wp:attachment":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/media?parent=1688"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/categories?post=1688"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/tags?post=1688"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}