gcc - 在 OS X 10.9 Mavericks 上编译 Mesos 时如何修复 "implicit instantiation"错误?

标签 gcc osx-mavericks mesos

升级到 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/

相关文章:

PHP 配置错误 : Please specify the install prefix of iconv with --with-iconv=<DIR>

c - pow 函数和 long int 导致问题

C++11:GCC 4.8 静态 thread_local std::unique_ptr 未定义引用

cocoa - Swift 应用程序未在 Mavericks 上启动

gmail - osx 上的 gmvault - 收到 IMAP 中止错误。等待 1 秒并重试

Mesos 马拉松不能毁掉工作

Mesos 现实世界用例

c - 打印带空格的函数入口和导出

c++ - 实践中的 union 、别名和类型双关语 : what works and what does not?

amazon-web-services - 在Amazon Linux上的Docker中启动Mesos从站会导致cgroup错误