Solution to macos protobuf2.4 Installation Error

Source: Internet
Author: User
When protobuf2.4 is compiled and installed (the specific installation method can be google), the following error occurs: binsh .. libtool -- tagCXX -- modecompileg-DHAVE_CONFIG_H-I.-I ..-D_THREAD_SAFE-Wall-Wwrite-strings-Woverloaded-virtual-Wno-sign-compare-O2-g-DNDEBUG-MTmessa

When protobuf 2.4 is compiled and installed (google can be used for installation), the following error occurs:/bin/sh .. /libtool -- tag = CXX -- mode = compile g-DHAVE_CONFIG_H-I. -I .. -D_THREAD_SAFE-Wall-Wwrite-strings-Woverloaded-virtual-Wno-sign-compare-O2-g-DNDEBUG-MT messa

When protobuf 2.4 is compiled and installed (google can be used for installation), the following error occurs:

/bin/sh ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..    -D_THREAD_SAFE  -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -O2 -g -DNDEBUG -MT message.lo -MD -MP -MF .deps/message.Tpo -c -o message.lo `test -f 'google/protobuf/message.cc' || echo './'`google/protobuf/message.cclibtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -D_THREAD_SAFE -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -O2 -g -DNDEBUG -MT message.lo -MD -MP -MF .deps/message.Tpo -c google/protobuf/message.cc  -fno-common -DPIC -o .libs/message.ogoogle/protobuf/message.cc:130:60: error: implicit instantiation of undefined template 'std::__1::basic_istream
 
   >'  return ParseFromZeroCopyStream(&zero_copy_input) && input->eof();                                                           ^/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iosfwd:108:28: note: template is declared here    class _LIBCPP_TYPE_VIS basic_istream;                           ^google/protobuf/message.cc:135:67: error: implicit instantiation of undefined template 'std::__1::basic_istream
  
    >'  return ParsePartialFromZeroCopyStream(&zero_copy_input) && input->eof();                                                                  ^/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iosfwd:108:28: note: template is declared here    class _LIBCPP_TYPE_VIS basic_istream;                           ^google/protobuf/message.cc:175:16: error: implicit instantiation of undefined template 'std::__1::basic_ostream
   
     >'  return output->good();               ^/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iosfwd:110:28: note: template is declared here    class _LIBCPP_TYPE_VIS basic_ostream;                           ^3 errors generated.make[2]: *** [message.lo] Error 1make[1]: *** [all-recursive] Error 1make: *** [all] Error 2
   
  
 
When an error is prompted, an error is exported. After searching and checking, you can find that you need to modify it.

The message. h file under $ {PROTOBUF_HOME}/src/google/protobuf is modified as follows:


# Ifdef _ DECCXX
// Hp c ++'s iosfwd doesn't work.
# Include
# Else
# Include
// # Include
# Endif

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.