mac os x 10.10.3 安裝protoc

來源:互聯網
上載者:User

標籤:

   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:

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

mac os x 10.10.3 安裝protoc

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.