简体   繁体   中英

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:

  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.
  2. Not defining the GetSrvRecords class somewhere and then not importing it.
  3. Not importing it correctly.
  4. You never defined GetSrvRecords()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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