Forked from rajkrrsingh/Google protobuf installation on Mac
Last active
August 21, 2019 07:31
-
-
Save icejoywoo/5de860bcd8a0fb7a0afe304cd73dd5d4 to your computer and use it in GitHub Desktop.
Steps to Install google protobuf on Mac
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # version 2.5.0 | |
| $wget https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.bz2 | |
| $tar xvf protobuf-2.5.0.tar.bz2 | |
| $cd protobuf-2.5.0 | |
| $./configure CC=clang CXX=clang++ CXXFLAGS='-std=c++11 -stdlib=libc++ -O3 -g' LDFLAGS='-stdlib=libc++' LIBS="-lc++ -lc++abi" | |
| $make -j 4 | |
| $sudo make install | |
| $protoc --version | |
| # version 2.4.1 | |
| # with -std=c++11 may encounter error: | |
| # google/protobuf/compiler/command_line_interface.cc:913:29: error: no matching function for call to 'make_pair' | |
| $wget https://github.com/google/protobuf/releases/download/v2.4.1/protobuf-2.4.1.tar.bz2 | |
| $tar xvf protobuf-2.5.0.tar.bz2 | |
| $cd protobuf-2.5.0 | |
| $./configure CC=clang CXX=clang++ CXXFLAGS='-stdlib=libc++ -O3 -g' LDFLAGS='-stdlib=libc++' LIBS="-lc++ -lc++abi" | |
| $make -j 4 | |
| $sudo make install | |
| $protoc --version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe encounter error like this when make version 2.4.1 :
Then, you can add header #include <istream> in the beginning of src/google/protobuf/message.cc