• <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++

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

            導航

            統計

            常用鏈接

            留言簿(4)

            隨筆分類(378)

            隨筆檔案(329)

            鏈接

            最新隨筆

            搜索

            最新評論

            久久久久久国产精品免费免费| 国产毛片欧美毛片久久久| 国产精品免费福利久久| 丰满少妇人妻久久久久久| 91精品观看91久久久久久| 久久精品无码一区二区日韩AV| 性做久久久久久久久浪潮| 婷婷久久久亚洲欧洲日产国码AV| 久久99精品国产99久久6男男| 国产综合免费精品久久久| 久久久久久久97| 91久久精品国产91性色也| 亚洲中文字幕无码久久综合网| 99精品伊人久久久大香线蕉| 东方aⅴ免费观看久久av| 狠狠精品干练久久久无码中文字幕| 免费精品国产日韩热久久| 久久夜色精品国产亚洲| 狠狠综合久久综合88亚洲| 热RE99久久精品国产66热| 国产精品久久久久jk制服| 一本久久a久久精品亚洲| 久久青青草原精品国产软件| 91精品日韩人妻无码久久不卡| 亚洲va国产va天堂va久久| 欧美国产成人久久精品| 国产日韩久久免费影院| 久久亚洲国产午夜精品理论片| 久久婷婷成人综合色综合| 伊人久久无码中文字幕| 亚州日韩精品专区久久久| 久久婷婷人人澡人人| 久久夜色精品国产亚洲av| 国产免费久久精品丫丫| 国产高清国内精品福利99久久| 久久99国产精一区二区三区| 精品综合久久久久久888蜜芽| 精品久久8x国产免费观看| 久久精品国产网红主播| 精品免费久久久久久久| 久久99国产精一区二区三区|