簡體   English   中英

在macOS上構建APT(我已經完成了大部分端口工作),但收到錯誤消息“使用未聲明的標識符'GetSrvRecords'”

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

我正在為macOS構建APT,我已經做了大部分補丁,並添加了一些從Linux移植到macOS的兼容性標頭,但是在make過程的“ 15%”告訴我時,我一直遇到問題:

  use of undeclared identifier 'GetSrvRecords'

我曾嘗試評論該行,但最終會導致更嚴重的錯誤

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;
}

它應該完全不顯示該問題。

您是:

  1. 不導入包含GetSrvRecords類的頭文件。
  2. 沒有在某個地方定義GetSrvRecords類,然后再不導入它。
  3. 無法正確導入。
  4. 您從未定義GetSrvRecords()

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM