developer-mayuan
12/10/2017 - 6:18 AM

Solve the issue when can not find environment varialbles in cpp.

Solve the issue when can not find environment varialbles in cpp.

  if (nullptr == getenv("DSM_WORKSPACE")) {
    char const *p = "DSM_WORKSPACE=/home/yuanma/SVN/Code/branch"
        "/workspace_yuan/DSM";
    putenv(const_cast<char *>(p));
  }

  std::string root_path = getenv("DSM_WORKSPACE");