• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            天下

            記錄修行的印記

            Google Protocol Buffer 安裝和使用

            Google Protocol Buffer 安裝和使用
            下載:
            https://codeload.github.com/google/protobuf/

            看README.md

            For non-C++ users, the simplest way to install the protocol compiler is to
            download a pre-built binary from our release page:
            [https://github.com/google/protobuf/releases]


            下載C++的版本:
            https://github.com/google/protobuf/releases

            進入:protobuf-3.0.2\cmake 目錄
            用cmake 處理編譯

            編譯默認的代碼生成是MT,不是MD

            只需要2個工程:
            libprotobuf和protoc

            編譯完成之后:把include目錄拷貝出來

            新建SearchRequest.proto文件
            message SearchRequest 
            {
              required string query = 1;
              optional int32 page_number = 2;// Which page number do we want?
              optional int32 result_per_page = 3;// Number of results to return per page.
            }

            protoc.exe --cpp_out ./ SearchRequest.poto
            #include "stdafx.h"
            #include "SearchRequest.pb.h"

            //#pragma comment(lib,"../Debug/MT/libprotobufd.lib")
            #pragma comment(lib,"../Debug/MD/libprotobufd.lib")

            int _tmain(int argc, _TCHAR* argv[])
            {
                SearchRequest sr;

                sr.set_query("abcd",5);
                sr.set_page_number(0x1001);
                sr.set_result_per_page(0x1002);

                std::string data  = sr.SerializeAsString();

                SearchRequest sr2;

                sr2.ParseFromString(data);

                return 0;
            }

            posted on 2016-09-22 10:19 天下 閱讀(556) 評論(0)  編輯 收藏 引用 所屬分類: C/C++

            <2016年9月>
            28293031123
            45678910
            11121314151617
            18192021222324
            2526272829301
            2345678

            導航

            統計

            常用鏈接

            留言簿(4)

            隨筆分類(378)

            隨筆檔案(329)

            鏈接

            最新隨筆

            搜索

            最新評論

            亚洲精品无码成人片久久| 欧美一区二区久久精品| 亚洲七七久久精品中文国产| 97久久国产亚洲精品超碰热| 亚洲国产精品无码久久久蜜芽| 久久青青草原精品国产软件| 观看 国产综合久久久久鬼色 欧美 亚洲 一区二区 | 成人国内精品久久久久影院| 久久天天躁狠狠躁夜夜躁2O2O| 免费精品久久天干天干| 久久久精品国产免大香伊 | 亚洲日本va午夜中文字幕久久 | 久久se精品一区二区| 97r久久精品国产99国产精| 久久精品国产亚洲综合色| 日本精品久久久久中文字幕8| segui久久国产精品| 欧美与黑人午夜性猛交久久久| 久久亚洲AV无码西西人体| 久久无码国产专区精品| 欧美噜噜久久久XXX| 国产成人精品久久二区二区| 国产精品99久久精品爆乳| 亚洲一区精品伊人久久伊人| 中文字幕乱码久久午夜| 久久久久亚洲精品天堂| 久久久无码精品午夜| 久久无码中文字幕东京热| 国产Av激情久久无码天堂| 国产一区二区精品久久岳| 中文字幕久久精品无码| 99久久精品国产一区二区蜜芽| 亚洲国产精品无码久久青草| 久久精品人人做人人妻人人玩| 国产69精品久久久久99尤物 | 久久青青草原精品国产软件 | 亚洲欧美日韩久久精品第一区| 久久福利青草精品资源站免费| 青青久久精品国产免费看| 国产V综合V亚洲欧美久久| 久久综合鬼色88久久精品综合自在自线噜噜|