当前位置:   article > 正文

linux下安装protobuf_linux系统安装protocbuf

linux系统安装protocbuf

1.去官网下载安装包https://github.com/google/protobuf/releases

2.解压安装包,并进入安装包

3.执行以下命令

  1. ./configure --prefix=/opt/local/protobuf
  2. make
  3. make check && make install

4.修改/ect/profile

  1. ####### add protobuf lib path ########
  2. #(动态库搜索路径) 程序加载运行期间查找动态链接库时指定除了系统默认路径之外的其他路径
  3. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/local/protobuf/lib/
  4. #(静态库搜索路径) 程序编译期间查找动态链接库时指定查找共享库的路径
  5. export LIBRARY_PATH=$LIBRARY_PATH:/opt/local/protobuf/lib/
  6. #执行程序搜索路径
  7. export PATH=$PATH:/opt/local/protobuf/bin/
  8. #c程序头文件搜索路径
  9. export C_INCLUDE_PATH=$C_INCLUDE_PATH:/opt/local/protobuf/include/
  10. #c++程序头文件搜索路径
  11. export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/opt/local/protobuf/include/
  12. #pkg-config 路径
  13. export PKG_CONFIG_PATH=/opt/local/protobuf/lib/pkgconfig/
  14. ######################################

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/1008983
推荐阅读
相关标签
  

闽ICP备14008679号