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