简体   繁体   English

在macOS上构建APT(我已经完成了大部分端口工作),但收到错误消息“使用未声明的标识符'GetSrvRecords'”

[英]Building APT on macOS (I already did most of port) but getting error “use of undeclared identifier 'GetSrvRecords'”

I am building APT for macOS, I already did most of patches and added some compatibility headers I ported from Linux to macOS all, but I have been encountering the problem at the "15%" of the make process telling me: 我正在为macOS构建APT,我已经做了大部分补丁,并添加了一些从Linux移植到macOS的兼容性标头,但是在make过程的“ 15%”告诉我时,我一直遇到问题:

  use of undeclared identifier 'GetSrvRecords'

I have tried commenting that lines but it ends up in an error that is worse 我曾尝试评论该行,但最终会导致更严重的错误

static bool DoSrvLookup(CommandLine &CmdL)              /*{{{*/
{
   if (CmdL.FileSize() <= 1)
      return _error->Error("Must specify at least one SRV record");

   for(size_t i = 1; CmdL.FileList[i] != NULL; ++i)
   {
      std::vector<SrvRec> srv_records;
      std::string const name = CmdL.FileList[i];
      c0out << "# Target\tPriority\tWeight\tPort # for " << name << std::endl;
      size_t const found = name.find(":");
      if (found != std::string::npos)
      {
     std::string const host = name.substr(0, found);
     size_t const port = atoi(name.c_str() + found + 1);
     if(GetSrvRecords(host, port, srv_records) == false)
        _error->Error(_("GetSrvRec failed for %s"), name.c_str());
      }
      else if(GetSrvRecords(name, srv_records) == false)
     _error->Error(_("GetSrvRec failed for %s"), name.c_str());

      for (SrvRec const &I : srv_records)
     ioprintf(c1out, "%s\t%d\t%d\t%d\n", I.target.c_str(), I.priority, I.weight, I.port);
   }
   return true;
}

It should make without showing that problem, at all. 它应该完全不显示该问题。

You are either: 您是:

  1. Not importing the header file that includes GetSrvRecords class. 不导入包含GetSrvRecords类的头文件。
  2. Not defining the GetSrvRecords class somewhere and then not importing it. 没有在某个地方定义GetSrvRecords类,然后再不导入它。
  3. Not importing it correctly. 无法正确导入。
  4. You never defined GetSrvRecords() 您从未定义GetSrvRecords()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM