• <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>
            隨筆 - 70, 文章 - 0, 評論 - 9, 引用 - 0
            數據加載中……

            Protocol Buffers (協議緩沖) 介紹及安裝

            Protocol Buffers是Google公司開發的一種數據描述語言,類似于XML能夠將結構化數據序列化,可用于數據存儲、通信協議等方面。現階段支

            持C++、JAVA、Python等三種編程語言。

            它是一種二進制的格式,比使用 xml 進行數據交換快許多。可以把它用于分布式應用之間的數據通信或者異構環境下的數據交換。


            http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/overview.html (介紹)
            http://code.google.com/p/protobuf/downloads/list  (下載)

            下載安裝
            編譯安裝(mingw):
              $ ./configure
              $ make
              $ make check
              $ make install
            詳細見:README.txt
            如果是Micosoft Visual C++,請參考vsprojects/readme.txt.

            在MSYS環境下安裝完后會自動設置好MSYS下的環境變量(PATH)。建議下載代碼的目錄也就是將要安裝好的目錄。


            value types can be numbers (integer or floating-point), booleans, strings, raw bytes, or even (as in the example above) other

            protocol buffer message types.
            specify optional fields, required fields, and repeated fields.

            once you've defined your messages, you run the protocol buffer compiler for your application's language on your .proto file to

            generate data access classes. These provide simple accessors for each field (like query() and set_query()) as well as methods to

            serialize/parse the whole structure to/from raw bytes.

            You can add new fields to your message formats without breaking backwards-compatibility; old binaries simply ignore the new field

            when parsing. So if you have a communications protocol that uses protocol buffers as its data format, you can extend your protocol

            without having to worry about breaking existing code.

            Why not just use XML?
            Protocol buffers have many advantages over XML for serializing structured data. Protocol buffers:
            are simpler
            are 3 to 10 times smaller
            are 20 to 100 times faster
            are less ambiguous
            generate data access classes that are easier to use programmatically.

            However, protocol buffers are not always a better solution than XML – for instance, protocol buffers would not be a good way to

            model a text-based document with markup (e.g. HTML), since you cannot easily interleave structure with text. In addition, XML is

            human-readable and human-editable; protocol buffers, at least in their native format, are not. XML is also – to some extent – self-

            describing. A protocol buffer is only meaningful if you have the message definition (the .proto file).

             To build and install your compiler, follow the instructions in the README.


            FAQ:
            1  編譯安裝時(make)出現錯誤:
            In file included from google/protobuf/compiler/command_line_interface.cc:54:
            ./google/protobuf/compiler/subprocess.h:80: error: extra qualification
            'google::
            protobuf::compiler::Subprocess::' on member 'Win32ErrorMessage'
            解決:將src/google/protobuf/compiler/subprocess.h:80的
            static string Subprocess::Win32ErrorMessage(DWORD error_code); 修改為:
            static string Win32ErrorMessage(DWORD error_code);
            參考: http://www.fourmilab.ch/fourmilog/archives/2006-05/000699.html

            2  編譯時(make)出現錯誤
            g++.exe: c:/msys/1.0/mingw/lib/gcc/mingw32/4.4.0/libstdc++.dll.a: No such file or directory
            解決:打開mingw下(D:\Qt\2010.05\mingw\lib\gcc\mingw32\4.4.0)的libstdc++.la (C:\Qt\2010.05\mingw\lib\gcc\mingw32\4.4.0下),將其中的
            # Names of this library.

            library_names='libstdc++.dll.a'
            修改為:
            # Names of this library.
            library_names='libstdc++.a'

            3  編譯時(make)出現彈出框錯誤
            "無法啟動此程序,因為計算機中丟失libgcc_s_dw2-1.dll。嘗試重新安裝該程序以解決問題"  或者
            the program can't start because libgcc_s_dw2-1.dll is missing from your computer. Try reinstalling the program to fix this problem.
            檢查了windows的環境變量和msys里的環境變量(PATH),都已經包含了C:\Qt\2010.05\mingw\bin,且該目錄下有 libgcc_s_dw2-1.dll,但

            問題仍然存在
            解決:將 libgcc_s_dw2-1.dll(C:\Qt\2010.05\mingw\bin)拷貝到exe的目錄下(protoc.exe所在的目錄C:\TDDOWNLOAD\protobuf-

            2.3.0\src)
            網上有說到更新libgcc_s_dw2-1.dll 的方法,未試。
            參考:http://forums.codeblocks.org/index.php?topic=11313.0


            4  在win7上會存在:執行make install時出現/bin/sh: /bin/install: Permission denied錯誤。
               解決:將環境變量增加:path:D:\protobuf-2.3.0\src。其中存在protoc.exe文件

            posted on 2011-01-20 09:20 seahouse 閱讀(3438) 評論(0)  編輯 收藏 引用 所屬分類: 數據

            久久精品九九亚洲精品| 久久精品无码一区二区app| 欧美精品福利视频一区二区三区久久久精品 | 国产亚洲美女精品久久久2020| 日日狠狠久久偷偷色综合免费 | 欧美日韩中文字幕久久伊人| 久久se精品一区精品二区| 久久无码av三级| 亚洲性久久久影院| 久久亚洲精品中文字幕三区| 久久久噜噜噜久久| 无码人妻久久一区二区三区| 狠狠狠色丁香婷婷综合久久俺| 精品熟女少妇aⅴ免费久久| A级毛片无码久久精品免费| 久久99精品综合国产首页| 亚洲国产成人精品91久久久 | 亚洲欧美成人综合久久久 | 久久精品国产亚洲AV久| 亚洲精品国产成人99久久| 99精品久久久久久久婷婷 | 国产产无码乱码精品久久鸭| 亚洲国产精品久久久久婷婷软件 | 欧美激情一区二区久久久| 东京热TOKYO综合久久精品| 一本综合久久国产二区| 国产精品久久久久乳精品爆| 色诱久久久久综合网ywww| 亚洲国产天堂久久综合| 久久se这里只有精品| 久久久久国产精品| 国产成人精品白浆久久69| 亚洲精品乱码久久久久66| 一本久久综合亚洲鲁鲁五月天亚洲欧美一区二区 | 久久国产精品99精品国产| 久久久久久免费视频| 午夜视频久久久久一区 | av无码久久久久不卡免费网站| 天堂无码久久综合东京热| 久久久久久亚洲精品不卡| 国产精品九九久久精品女同亚洲欧美日韩综合区 |