ace*_*es. 23 java windows cygwin mingw protocol-buffers
我无法找到在Windows x64平台上安装Google协议缓冲区(包括编译器)的明确说明.
我查看了README文件的编译和源代码:
对于编译器:要安装,只需将此二进制文件放在PATH中的某个位置即可
我将系统变量添加到Path: PROTOC'C:\ dev_tools\protoc-2.4.1-win32'
我坚持使用Cygwin安装Protocol Buffers源代码.我尝试按照自述文件中提供的Unix说明操作:
要构建和安装C++ Protocol Buffer运行时和Protocol Buffer编译器(protoc),请执行以下命令:
$ ./configure $ make $ make check $ make install
如果"make check"失败,您仍然可以安装,但该库的某些功能可能无法在您的系统上正常运行.继续需要您自担风险.
"make install"可能需要超级用户权限.
有关configure和make的高级用法信息,请参阅INSTALL.txt.
**提示安装位置**
默认情况下,程序包将安装到/ usr/local.但是,在许多平台上,/ usr/local/lib不是LD_LIBRARY_PATH的一部分.您可以添加它,但可能更容易安装到/ usr.为此,请按如下方式调用configure:
./configure --prefix =/usr
我得到'-bash:./ configure:没有这样的文件或目录' 有人可以提供明确而详细的步骤来使其工作吗?
--------------- 更新 -----------------
我转而使用MSYS/MINGW32而是按照此链接中的说明进行操作.现在我坚持以下:
当我运行'./configure'命令时,我得到以下错误:
检查如何运行C++预处理器.../lib/cpp
configure:错误:C++预处理器"/ lib/cpp"无法进行健全性检查'
因此,make,make install命令都不起作用.
例如:make:*未指定目标且未找到makefile.停止.**
谢谢
在Windows上有一个用于编译protobuf的完整文档文件:
你需要7-zip,Cmake和Visual Studio.
无论如何,使用持续集成工具(如Travis或Appveyor)的一个意想不到的副作用是始终有最新的工作构建脚本可用.我正好总是看appveyor.yml
和travis_config.yml
文件时,他们的存在.
>>> git clone -b v3.1.0 https://github.com/google/protobuf.git
>>> cd protobuf
>>> curl -L -o release-1.7.0.zip https://github.com/google/googlemock/archive/release-1.7.0.zip
>>> 7z x release-1.7.0.zip
>>> del /Q release-1.7.0.zip
>>> rename googlemock-release-1.7.0 gmock
>>> curl -L -o release-1.7.0.zip "https://github.com/google/googletest/archive/release-1.7.0.zip"
>>> 7z x release-1.7.0.zip
>>> del /Q release-1.7.0.zip
>>> rename googletest-release-1.7.0 gtest
>>> move gtest gmock
>>> set generator=Visual Studio 12 Win64
>>> set vcplatform=x64
>>> mkdir build_msvc
>>> cd build_msvc
>>> cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% ../cmake
>>> msbuild protobuf.sln /p:Platform=%vcplatform% || goto error
Run Code Online (Sandbox Code Playgroud)
你需要curl
(Git Bash
有它)以及解析7z.exe
和Msbuild.exe
可执行文件的路径.
我成功地使用Visual Studio 2015在Windows 10 x64机器上构建了protobuf编译器.
用于在 Windows 中安装 proto buff
转到https://github.com/protocolbuffers/protobuf/releases
向下滚动并下载 Windows 兼容的 zip
下载 zip 后,将其解压缩到 C:/
只需复制路径, C:\protoc-3.17.3-win64\bin
并将其设置为环境变量的路径
希望这可以帮助!
小智 5
从下载 protoc-2.5.0-win32.zip
https://github.com/protocolbuffers/protobuf/releases/tag/v2.5.0
然后安装,只需将此二进制文件放在 PATH 中的某个位置
归档时间: |
|
查看次数: |
39849 次 |
最近记录: |