
Hi Jonathan,
I've just tried building the program_options library, using GCC 3.4.1 on FreeBSD 4.8 and hit a couple of compilation errors. One error is caused by the platform, one by the compiler's stdlib.
The first problem is line 116 in libs/program_options/src/utf8_codecvt_facet.cpp
/data/development/jw/src/extcvs/boost/libs/program_options/build/../src/utf8_codecvt_facet.cpp:116: error: `WCHAR_MAX' undeclared (first use this function) /data/development/jw/src/extcvs/boost/libs/program_options/build/../src/utf8_codecvt_facet.cpp:116: error: (Each undeclared identifier is reported only once for each function it appears in.)
WCHAR_MAX is not defined by FreeBSD's wchar.h. Can boost::numeric_limits<wchar_t> be used instead?
Does FreeBSD's wchar.h defines anything similiar? If not, could you indeed try using boost::numeric_limits. If it works, I'll make the change in CVS and see if this breaks anything else.
The second problem is visible because I built GCC with concept-checks enabled, which means the STL containers use a version of Boost's concept checks. This reveals that boost/program_options/options_description.hpp uses an incomplete type on line 232:
Hmmm.... the boiled down example is: class options_description { std::vector<options_description> groups; }; I'm really not sure what's going on there, because the standard does not say if instantinating a vector with incomplete type is allowed (or disallowed). Further, somehow the main regression tests have no problems.
This error can be reproduced by compiling with -D_GLIBCXX_CONCEPT_CHECKS, or -D_GLIBCXX_DEBUG. Both the concept-checks and debug mode will reject std::vector< incomplete type >.
For me only _GLIBCXX_CONCEPT_CHECKS triggers the error (on Debian). So the primary question: is it allowed to instantiate vector with incomplete type? If yes, it's a bug in g++, otherwise, it's a bug in program options. - Volodya
jon