在Windows上安装协议缓冲区 [英] Install Protocol Buffers on Windows

查看:52
本文介绍了在Windows上安装协议缓冲区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到在Windows x64平台上安装Google协议缓冲区(包括编译器)的明确说明.

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:

对于编译器:要安装,只需将此二进制文件放在PATH中的某处

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'

我一直坚持使用Cygwin安装协议缓冲区源.我尝试了以下自述文件中提供了Unix指令:

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

构建并安装C ++协议缓冲区运行时和协议缓冲区编译器(协议)执行以下操作:

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

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

如果 make check 失败,您仍然可以安装,但是很可能该库的某些功能在您的系统上无法正常工作.后果自负.

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.

有关配置和制作的高级用法信息,请参阅INSTALL.txt.

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

**安装位置的提示**

** Hint on install location **

默认情况下,该软件包将安装到/usr/local.但是,在许多平台上,/usr/local/lib都不是LD_LIBRARY_PATH的一部分.您可以添加它,但是将其安装到/usr>可能会更容易.为此,请按以下方式调用configure:

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

我知道

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

有人可以提供清晰详细的步骤来完成这项工作吗?

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

我改用MSYS/MINGW32,而我按照此链接中给出的说明进行操作.现在,我坚持以下做法:

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

当我运行'./configure'命令时,出现以下错误:
检查如何运行C ++预处理器.../lib/cpp
配置:错误:C ++预处理器"/lib/cpp"未通过健全性检查'

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'

因此,make,make install命令都不起作用.例如:

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

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

推荐答案

如果您只想编译ProtoBuf定义,则可以下载适用于所有平台的protoc的预编译二进制文件,位于ProtoBuf GitHub版本页面上.

If you just want to compile ProtoBuf definitions, you can download precompiled binaries of protoc for all platforms right on the ProtoBuf GitHub releases page.

至少从2015年开始,它们就已经预编译了二进制文件,但是很容易在许多下载之间忽略它们.

They had precompiled binaries at least since 2015, but it's easy to overlook them in between the many downloads.

这篇关于在Windows上安装协议缓冲区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆