2014-08-09 wcdj
(1) 第一步,./configure没问题。
./configure --prefix=/Users/gerryyang/LAMP/protobuf/install/protobuf-2.4.1
(2) 第二步,make,报错如下:
google/protobuf/message.cc:130:60: error: implicit instantiation of undefined template
'std::__1::basic_istream<char, std::__1::char_traits<char> >'
return ParseFromZeroCopyStream(&zero_copy_input) && input->eof();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iosfwd:109:33: note:
template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_istream;
^
google/protobuf/message.cc:135:67: error: implicit instantiation of undefined template
'std::__1::basic_istream<char, std::__1::char_traits<char> >'
return ParsePartialFromZeroCopyStream(&zero_copy_input) && input->eof();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iosfwd:109:33: note:
template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_istream;
^
google/protobuf/message.cc:175:16: error: implicit instantiation of undefined template
'std::__1::basic_ostream<char, std::__1::char_traits<char> >'
return output->good();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iosfwd:111:33: note:
template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_ostream;
^
3 errors generated.
make[2]: *** [message.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
根据错误信息,对报错的文件进行如下修改:
protobuf-2.4.1/src/google/protobuf/message.cc,添加#include<istream>