|
From: Keith M. <kei...@us...> - 2009-08-31 20:08:29
|
On Monday 31 August 2009 12:32:28 Chris Sutcliffe wrote: > > A few questions: > > setenv/unsetenv seems to be in libiberty (is that GPL or > > free to use in proprietary applications? > > What are you trying to do? Looking in the MinGW headers, setenv / > unsetenv aren't defined. Perhaps using Windows functions (i.e. > SetEnvironmentVariable) may be an option? Like Chris says, setenv() and unsetenv() are not supported in MinGW, because they aren't supported by the MSVCRT runtime library. The usual alternative choice is putenv() -- it's somewhat more portable than any Microsoft specific choice; putenv( "FOO=value" ) is the alternative to setenv( "FOO", "value", 1 ), while putenv( "FOO=" ) has a rather less portable effect similar to unsetenv( "FOO" ). -- Regards, Keith. |