升级到 OS X Mavericks 后,运行 make
在我的 Mesos 构建目录中导致错误:
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: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<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: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<char, std::__1::char_traits<char> >'
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;
我从一个干净的构建目录开始,重新运行
./bootstrap
,然后跑 cd build && ../configure
.
最佳答案
对于那些在谷歌搜索错误消息时发现此页面的人来说,这些错误消息是由一些依赖于旧版本谷歌的软件引发的protobuf
图书馆,这是另一个解决方案:
修改文件src/google/protobuf/message.cc
并添加行 #include <iostream>
在开头评论块之后,就在 #include
的所有其余部分之前线。一行更改足以让我编译 protoc
来自 protobuf-2.4.1
在 El Capitan Mac 上使用来自 XCode 7.3 的命令行工具。
关于gcc - 在 OS X 10.9 Mavericks 上编译 Mesos 时如何修复 "implicit instantiation"错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19719684/