Configuring PROTOBUF 3.0 Golang Environment under Mac

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

http://studygolang.com/articles/4451


PROTOBUF 3.0   The syntax of the previous PROTOBUF 2.6 is not the same. To reinstall, the native environment is OS X Yosemite  10.10.21. Do not use home brew installation, installed with Homebrew will encounter an open issue https://github.com/homebrew/homebrew/issues/30320  problem, Without careful study, simply do a manual installation of;    But here's a way to record a custom brew's formula:    (1) If you use  brewINSTALL  directly PROTOBUF installation, the current default version of the installation is still 2.6.1, so you need to modify a brew formula, let Brew to find 3.0 version of the following methods:              sudo Brew create https://github.com/google/protobuf/archive/v3.0.0-alpha-3.tar.gz              will be required to enter formula name, enter PROTOBUF to,              Installed Protobuf, will report protobuf.rb already existing errors, directly delete the protobuf.rb file can be;              And if you have previously installed a different version of PROTOBUF, you can use sudo brew remove protobuf Delete;    (2) After the above deployment is done, a vim editing page will pop up, and the direct save can be;    (3) Then the direct installation of sudo brewinstall protobuf,brew will download the 3.0 version, and then install, and then report the  https://github.com/homebrew/homebrew/issues/30320  's problem. Interested can study .... 2. Go straight to the chase, manually install protobuf,    (1) to download https://github.com/google/protobuf/archive/v3.0.0-alpha-3.tar.gz  Unzip, CD into the compressed directory under the;    (2) would have been installed in accordance with the normal installation of the Linux software, but found no configure script ... I don't know why I got a autogen.sh script that was used to generate a configure script, run sudo./autogen.sh, find out the problem ....     (3) autogen.sh script seems to be going to gtest, it needs FQ, after hanging the VPNFQ, Gtest Run successfully, (4) Gtest success, will also report the lack of autoreconf package errors, with Sudo brew automake to solve the problem, (5) will also error ... Will report the lack of libtool problems, with Sudo brew libtool to solve; (6) Then, no problem. Can be run directly in order./configure; make; Makecheck; Make install, after successful installation, directly Protoc--version to see if the installed version is correct, return to Libprotoc 3.0.0, indicating the successful installation; 3. Due to the configuration of Protobuf Golang environment, also need to install Golang plug-ins, plug-in installation method is relatively simple; (1) Go get-u-v github.com/golang/protobuf/proto go g Et-u-V Github.com/golang/protobuf/protoc-gen-go two steps to install the Go plugin, one more step is:The sudo cp $GOPATH/bin/protoc-gen-go/usrlocal/bin moves the protoc-gen-go to the system $path, Otherwise, you will get an error when using Protoc: Protoc-gen-go not found4. So far, the Golang environment for Mac PROTOBUF 3.0 has been configured. You can use Protoc--go_out=. *.proto to generate the proto corresponding go file

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.