Cài đặt protobuf cho windows java

I am unable to find clear instructions to install Google Protocol Buffers (including compiler) on Windows x64 platform.

I went through the instructions README file for compiler and source:

For Compiler: To install, simply place this binary somewhere in your PATH

I added system variable to Path:

PROTOC 'C:\dev_tools\protoc-2.4.1-win32'

I am stuck on installing Protocol Buffers source using Cygwin. I tried following Unix instructions provided in the readme file:

To build and install the C++ Protocol Buffer runtime and the Protocol Buffer compiler (protoc) execute the following:

$ ./configure
$ make
$ make check
$ make install

If make check fails, you can still install, but it is likely that some features of this library will not work correctly on your system. Proceed at your own risk.

make install may require superuser privileges.

For advanced usage information on configure and make, see INSTALL.txt.

** Hint on install location **

By default, the package will be installed to /usr/local. However, on many platforms, /usr/local/lib is not part of LD_LIBRARY_PATH. You can add it, but it may be easier to just install to /usr> instead. To do this, invoke configure as follows:

./configure --prefix=/usr

I get

-bash: ./configure: No such file or directory'

Can some one provide clear and detailed steps to make this work?

UPDATE

I switched to using MSYS/MINGW32 instead and I followed instructions given in this link. Now I am stuck with following:

When I run the './configure' command I get following error:
checking how to run the C++ preprocessor... /lib/cpp
configure: error: C++ preprocessor "/lib/cpp" fails sanity check'

As a result, none of the make, make install commands work. For eg:

make: No targets specified and no makefile found. Stop.

Tôi không thể tìm thấy hướng dẫn rõ ràng để cài đặt Google Protocol Buffers (bao gồm cả trình biên dịch) trên nền tảng Windows x64.

Tôi đã xem qua hướng dẫn tệp README cho trình biên dịch và nguồn:

Đối với Trình biên dịch: Để cài đặt, chỉ cần đặt tệp nhị phân này ở đâu đó trong PATH của bạn

Tôi đã thêm biến hệ thống vào Path:

PROTOC 'C:\dev_tools\protoc-2.4.1-win32'

Tôi gặp khó khăn khi cài đặt nguồn Bộ đệm Giao thức bằng Cygwin. Tôi đã thử làm theo hướng dẫn Unix được cung cấp trong tệp readme:

Để xây dựng và cài đặt thời gian chạy Bộ đệm Giao thức C ++ và trình biên dịch Bộ đệm Giao thức (protoc), hãy thực hiện như sau:

$ ./configure
$ make
$ make check
$ make install

Nếu make checkkhông thành công, bạn vẫn có thể cài đặt, nhưng rất có thể một số tính năng của thư viện này sẽ không hoạt động chính xác trên hệ thống của bạn. Tiến hành với rủi ro của riêng bạn.

make install có thể yêu cầu đặc quyền siêu người dùng.

Để biết thông tin sử dụng nâng cao về cấu hình và tạo, hãy xem INSTALL.txt.

** Gợi ý về vị trí cài đặt **

Theo mặc định, gói sẽ được cài đặt thành / usr / local. Tuy nhiên, trên nhiều nền tảng, / usr / local / lib không phải là một phần của LD_LIBRARY_PATH. Bạn có thể thêm nó, nhưng có thể dễ dàng hơn chỉ cần cài đặt vào / usr>. Để thực hiện việc này, hãy gọi cấu hình như sau:

./configure --prefix=/usr

tôi có

-bash: ./configure: No such file or directory'

Một số người có thể cung cấp các bước rõ ràng và chi tiết để thực hiện việc này không?

CẬP NHẬT

Thay vào đó, tôi đã chuyển sang sử dụng MSYS / MINGW32 và tôi đã làm theo hướng dẫn được đưa ra trong liên kết này . Bây giờ tôi gặp khó khăn với việc sau:

Khi tôi chạy lệnh './configure', tôi gặp lỗi sau:
kiểm tra cách chạy bộ tiền xử lý C ++ ... / lib / cpp
configure: error: C ++ preprocessor "/ lib / cpp" fail sanity check '

Do đó, không có lệnh make, make install hoạt động. Ví dụ:

make: No targets specified and no makefile found. Stop.

38 hữu ích 3 bình luận 76k xem chia sẻ

Stay organized with collections Save and categorize content based on your preferences.

What are protocol buffers?

Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages.

Pick your favorite language

Protocol buffers currently support generated code in Java, Python, Objective-C, and C++. With our new proto3 language version, you can also work with Kotlin, Dart, Go, Ruby, and C#, with more languages to come.

[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }] [{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]