mac php protobuf,macos安装protobuf2.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.cc

libtool: 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.o

google/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 1

make[1]: *** [all-recursive] Error 1

make: *** [all] Error 2

错误提示的时,导错了,经过搜索和检查,发现需要修改

${PROTOBUF_HOME}/src/google/protobuf下的message.h文件,具体修改方式如下:

#ifdef __DECCXX

// HP C++'s iosfwd doesn't work.

#include #else

#include //#include #endif 本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉 本文系统来源:php中文网

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值