[program_options] post-review version -- compile problem

Hi, I just downloaded and compiled the version 262 of the library using Mingw (gcc 3.2.3) and I ran into a problem compiling parser.cpp: The function parse_environment contains the following lines: #if defined(_WIN32) char **environ = _environ; #endif But the mingw provided stdlib.h contains an unconditional #define environ _environ So it does not compile :-( I changed parser.cpp to #if defined(_WIN32) && !defined( __MINGW32__ ) char **environ = _environ; #endif And now it compiles and the samples run, but I have not actually tried to use enviroment variables. Also I checked the stdlib.h provided with MSVC6.5 and that contains #ifdef _POSIX_ extern char ** environ; /* pointer to environment table */ #else But I guess this would not cause a problem when _POSIX_ is defined, because the local environ would just hide the one from stdlib.h. And a small question, is the library supposed to work with 6.5 at all? I get a rather large amount of errors and warnings when I try to build it. I haven't looked into them yet, if it is not supposed to work then I won't spend any time on it. Rob Lievaart

Hi Rob, Rob Lievaart wrote:
But the mingw provided stdlib.h contains an unconditional
#define environ _environ
So it does not compile :-(
I changed parser.cpp to
#if defined(_WIN32) && !defined( __MINGW32__ ) char **environ = _environ; #endif
And now it compiles and the samples run,
I've applied this workaround and updated the packages.
but I have not actually tried to use enviroment variables.
I might want to run "bjam" in the "test" directory -- the parsers_test.cpp includes test for environment variables handling.
Also I checked the stdlib.h provided with MSVC6.5 and that contains
#ifdef _POSIX_ extern char ** environ; /* pointer to environment table */ #else
But I guess this would not cause a problem when _POSIX_ is defined, because the local environ would just hide the one from stdlib.h.
Yes, I think that's okay.
And a small question, is the library supposed to work with 6.5 at all? I get a rather large amount of errors and warnings when I try to build it. I haven't looked into them yet, if it is not supposed to work then I won't spend any time on it.
Nope, it was not supposed to work. For now, I was interested in finalizing interface and getting the library into CVS. I am not sure how hard it will be to support 6.5 -- this remains to be seen. Thanks, Volodya

Neal D. Becker wrote:
Rob Lievaart wrote:
Hi,
I just downloaded and compiled the version 262 of the
Excuse me, but where are updated versions found?
http://zigzag.cs.msu.su:7813/repos/trunk/program_options with Subversion and http://zigzag.cs.msu.su:7813/program_options or http://zigzag.cs.msu.su/~ghost/program_options for packages. - Volodya
participants (3)
-
Neal D. Becker
-
Rob Lievaart
-
Vladimir Prus