Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Steps to Install google protobuf on Mac
$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
@akiasprin
Copy link

akiasprin commented Mar 8, 2019

try it: brew install protobuf@2.5 :)

@guoshuai
Copy link

guoshuai commented Mar 30, 2019

It won't work unfortunately because protobuf@2.5 formula has been deprecated.

@sriki77
Copy link

sriki77 commented Jun 30, 2019

thank you very much. big time saver

@haiboself
Copy link

haiboself commented Sep 1, 2019

thanks a lot.

@plainbanana
Copy link

plainbanana commented Sep 10, 2019

thanks. it still works at Mojave.

@snemuri
Copy link

snemuri commented Oct 15, 2019

Awesome, Thanks @rajkrrsingh !!

@djcvijic
Copy link

djcvijic commented Nov 14, 2019

Extremely helpful <3

@adigunhammedolalekan
Copy link

adigunhammedolalekan commented Nov 14, 2019

Try brew install protobuf

@weina2018
Copy link

weina2018 commented Nov 23, 2019

Hi there, anyone could help to have the new version of "https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.bz2" as it appears too old to install protobuf on macOS now thank you in advance, Edina

@weina2018
Copy link

weina2018 commented Nov 23, 2019

I tried brew install protobuf, then brew link --overwrite protobuf it works on Macos with protobuf /3.10.1

@StanSun
Copy link

StanSun commented Dec 1, 2019

~ brew install protobuf
➜ ~ protoc --version
libprotoc 3.11.0

@datng2
Copy link

datng2 commented Dec 6, 2019

For those who running on Mac OS Mojave 10.14 ran into error while running this line:

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

The fix is to install macOS_SDK_headers_for_macOS

open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

# If you are still not be able to install this, probably you have to manually remove the /Library/Developer/CommandLineTools to install the latest version
# (Optional) : In case of failure
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install

@chaoman
Copy link

chaoman commented Feb 25, 2020

Thanks so much. Got it working.

@Stephan14
Copy link

Stephan14 commented Mar 1, 2020

good!

@SamsonLai
Copy link

SamsonLai commented Mar 25, 2020

It works on my Mac, Thanks a lot!

@deximat
Copy link

deximat commented Jun 1, 2020

Thank you!

@bhupathiv
Copy link

bhupathiv commented Oct 19, 2020

It works perfectly on my Mac. Thanks you very much..

@ijulanday
Copy link

ijulanday commented Nov 24, 2020

Needed to install protobuf 3.13.0 with 3.14.0 currently installed on Catalina 10.15.7–worked perfectly!

@vineetgarg02
Copy link

vineetgarg02 commented Feb 11, 2021

Anyone got this working on Apple silicon?

@guanjinke
Copy link

guanjinke commented Mar 16, 2021

Thanks a lot!

@april1989
Copy link

april1989 commented Mar 18, 2021

Still working !!!

@tj-byun
Copy link

tj-byun commented May 7, 2021

Thank you!

@dzypersonal
Copy link

dzypersonal commented May 27, 2021

Failed on mac big sur, exception like this:
./google/protobuf/stubs/atomicops_internals_macosx.h:158:43: error: unknown type name 'Atomic64'; did you mean 'Atomic32'?
Atomic64 increment) {
^~~~~~~~
Atomic32
Does anyone have an idea?

@tianhong-1
Copy link

tianhong-1 commented Jul 27, 2021

Anyone got this working on Apple silicon?

No works

@tianhong-1
Copy link

tianhong-1 commented Jul 27, 2021

Failed on mac big sur, exception like this:
./google/protobuf/stubs/atomicops_internals_macosx.h:158:43: error: unknown type name 'Atomic64'; did you mean 'Atomic32'?
Atomic64 increment) {
^~~~~~~~
Atomic32
Does anyone have an idea?

me too

@tianhong-1
Copy link

tianhong-1 commented Jul 27, 2021

Failed on mac big sur, exception like this:
./google/protobuf/stubs/atomicops_internals_macosx.h:158:43: error: unknown type name 'Atomic64'; did you mean 'Atomic32'?
Atomic64 increment) {
^~~~~~~~
Atomic32
Does anyone have an idea?

Have you solved it?

@tianhong-1
Copy link

tianhong-1 commented Jul 27, 2021

./google/protobuf/stubs/atomicops_internals_macosx.h:157:52: error: unknown type name 'Atomic64'; did you mean 'Atomic32'?
inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
^~~~~~~~
Atomic32

@valiantljk
Copy link

valiantljk commented Aug 21, 2021

Thanks

@lijunldn
Copy link

lijunldn commented Aug 28, 2021

Thanks! It worked on my macOS Catalina v10.16.7

@chenchun
Copy link

chenchun commented Oct 27, 2021

Failed on mac big sur, exception like this:
./google/protobuf/stubs/atomicops_internals_macosx.h:158:43: error: unknown type name 'Atomic64'; did you mean 'Atomic32'?
Atomic64 increment) {
^~~~~~~~
Atomic32
Does anyone have an idea?

Have you solved it?

I find it worked following protocolbuffers/protobuf#8836 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment