【发布时间】:2015-05-17 22:05:13
【问题描述】:
我有一个对std::setenv 的简单调用,它在gcc 下的我的Linux 发行版上运行良好。但是,在我的 Mac OS X 上使用 clang 时,我收到以下错误。
error: no member named 'setenv' in namespace 'std'; did you mean simply 'setenv'?
std::setenv(name.c_str(), value.c_str(), true);
我确定,我在某处读到 setenv 是 C++11 中命名空间 std 的一部分,但现在我不确定。
问题:应该使用setenv还是std::setenv,为什么会这样?
【问题讨论】:
标签: c++ c++11 environment-variables