• <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 天下 閱讀(567) 評論(0)  編輯 收藏 引用 所屬分類: C/C++

            <2012年8月>
            2930311234
            567891011
            12131415161718
            19202122232425
            2627282930311
            2345678

            導航

            統(tǒng)計

            常用鏈接

            留言簿(4)

            隨筆分類(378)

            隨筆檔案(329)

            鏈接

            最新隨筆

            搜索

            最新評論

            国内精品久久国产| 久久久精品午夜免费不卡| 国产毛片久久久久久国产毛片 | 久久免费视频一区| 国产香蕉久久精品综合网| 亚洲精品国产字幕久久不卡| 国产精品一区二区久久国产| 国产一区二区精品久久凹凸| 久久人妻少妇嫩草AV蜜桃| avtt天堂网久久精品| 久久精品国产色蜜蜜麻豆| 伊人久久精品无码二区麻豆| 国产精品免费久久久久影院| 久久精品成人欧美大片| 国产精品熟女福利久久AV| 综合网日日天干夜夜久久| 久久高清一级毛片| 久久久老熟女一区二区三区| 天天综合久久一二三区| 日韩精品久久久久久| 色婷婷综合久久久中文字幕 | 久久天天婷婷五月俺也去| 久久福利青草精品资源站免费| 亚洲国产成人久久一区WWW| 久久国产成人精品麻豆| AV狠狠色丁香婷婷综合久久| 波多野结衣久久一区二区| 久久有码中文字幕| 国产A级毛片久久久精品毛片| 久久精品99久久香蕉国产色戒| 一本久久综合亚洲鲁鲁五月天亚洲欧美一区二区| 久久99精品久久久久久久不卡 | 久久综合狠狠综合久久激情 | 青青草原综合久久大伊人导航 | 久久久久亚洲AV成人网人人软件| 久久精品国产亚洲AV麻豆网站| 一本色道久久99一综合| 久久久久亚洲av成人网人人软件| 久久精品免费全国观看国产| 亚洲精品无码久久不卡| 狠狠色丁香久久婷婷综合_中 |