您好,欢迎访问一九零五行业门户网

mac os安装protobuf 2.4错误解决方法

在编译安装protobuf 2.4时(具体安装方法可以google),出现如下错误: /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
在编译安装protobuf 2.4时(具体安装方法可以google),出现如下错误:
/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
错误提示的时,导错了,经过搜索和检查,发现需要修改${protobuf_home}/src/google/protobuf下的message.h文件,具体修改方式如下:
#ifdef __deccxx
// hp c++'s iosfwd doesn't work.
#include
#else
#include
//#include
#endif
其它类似信息

推荐信息