< Previous by Date Date Index Next by Date >
  Thread Index  

[reSIProcate] problem with getenv() in wince


Dear all,
 
The library i sent yesterday (to c-ares forum ), it can't work in wince,although the compiler
doesn't make error.Cos today i tried to rework an example which i run successful in visual studio 7.1,
i failed.
 
Today, i tried so much to solve a lots of problems about warnings.
Until now, i met a big problem. Cos wince doesn't support getenv().
You can find getenv in fonction init_by_environment(ares_channel channel) in the end.
The error when i tested like this:
 
  aresWince.lib(ares_init.obj) : error LNK2019: unresolved external symbol _getenv referenced in function _init_by_environment
  aresWince.lib(ares_search.obj) : error LNK2019: unresolved external symbol _getenv referenced in function _single_domain

How can i pass this ? If i don't use getenv(), what will come?
Need your comment?
 
 
static int init_by_environment(ares_channel channel)
{
  const char *localdomain, *res_options;
  int status;

   localdomain = getenv("LOCALDOMAIN");
  if (localdomain && channel->ndomains == -1)
    {
      status = set_search(channel, localdomain);
      if (status != ARES_SUCCESS)
 return status;
    }

  res_options = getenv("RES_OPTIONS");
  if (res_options)
    {
      status = set_options(channel, res_options);
      if (status != ARES_SUCCESS)
 return status;
    }

  return ARES_SUCCESS;
}