zoukankan      html  css  js  c++  java
  • mac os x 10.10.3 安装protoc

    预装如下环境

    autoconf 2.6.9
    automake 1.14
    libtool 2.4

     
    Building from source

    Download latest version of procbuffer. [https://code.google.com/p/protobuf/downloads/list].

    1. e.g  "wget https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.bz2"

    Untar the tar.bz2 file

    1. tar xfvj protobuf-2.5.0.tar.bz2 

    Configure the protobuf. 

    1.  cd protobuf-2.5.0
    2. ./configure CC=clang CXX=clang++ CXXFLAGS='-std=c++11 -stdlib=libc++ -O3 -g' LDFLAGS='-stdlib=libc++' LIBS="-lc++ -lc++abi"

    Make the source 

    1. make -j 4 
    2. sudo make install
     
    在make -j 4时,可能出现如下错误
    In file included from ./google/protobuf/stubs/common.h:41:
    In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/string:439:
    In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/algorithm:628:
    In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:604:
    /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iterator:341:10: fatal error: '__debug' file not found

    遇到如上错误:执行如下命令

    echo '#define _LIBCPP_ASSERT(x, m) ((void)0)' | sudo tee -a /Library/Developer/CommandLineTools/usr/include/c++/v1/__debug > /dev/null

    reference:

    https://github.com/google/protobuf/issues/74

    http://sleepythread.blogspot.com/2013/11/installing-protoc-25x-compiler-google.html

    https://github.com/JuliaLang/julia/issues/10822

    http://stackoverflow.com/questions/29529455/missing-c-header-debug-after-updating-osx-command-line-tools-6-3

  • 相关阅读:
    三连击
    铺地毯
    超级玛丽游戏
    A+B problem
    怎么感觉欠缺点什么、灵光在哪,让我顿悟下
    2016年10月,人生的转折点。
    python第七天
    python第六天
    汉诺塔问题(Hanoi Tower)递归算法解析(Python实现)
    计算多数的乘积(Python实现)
  • 原文地址:https://www.cnblogs.com/yanghuahui/p/4448728.html
Copyright © 2011-2022 走看看