Boost logo

Boost :

From: Jonathan Wakely (cow_at_[hidden])
Date: 2004-07-21 08:04:26


Hi Boosters,

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

gcc-C++-action bin/boost/libs/program_options/build/libboost_program_options.a/gcc/debug/utf8_codecvt_facet.o
/data/development/jw/src/extcvs/boost/libs/program_options/build/../src/utf8_codecvt_facet.cpp: In member function `virtual std::codecvt_base::result boost::program_options::detail::utf8_codecvt_facet_wchar_t::do_out(mbstate_t&, const wchar_t*, const wchar_t*, const wchar_t*&, char*, char*, char*&) const':
/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?

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:

gcc-C++-action bin/boost/libs/program_options/build/libboost_program_options.a/gcc/debug/options_description.o
In file included from /data/development/jw/src/extcvs/boost/libs/program_options/build/../src/options_description.cpp:9:
/data/development/jw/gcc/3.4/bin/../lib/gcc/i386-unknown-freebsd4.8/3.4.1/../../../../include/c++/3.4.1/bits/boost_concept_check.h: In instantiation of `__gnu_cxx::_SGIAssignableConcept<boost::program_options::options_description>':
/data/development/jw/gcc/3.4/bin/../lib/gcc/i386-unknown-freebsd4.8/3.4.1/../../../../include/c++/3.4.1/bits/stl_vector.h:144: instantiated from `std::vector<boost::program_options::options_description, std::allocator<boost::program_options::options_description> >'
/data/development/jw/src/extcvs/boost/boost/program_options/options_description.hpp:232: instantiated from here
/data/development/jw/gcc/3.4/bin/../lib/gcc/i386-unknown-freebsd4.8/3.4.1/../../../../include/c++/3.4.1/bits/boost_concept_check.h:216: error: `__gnu_cxx::_SGIAssignableConcept<_Tp>::__a' has incomplete type
/data/development/jw/src/extcvs/boost/boost/program_options/options_description.hpp:142: error: forward declaration of `class boost::program_options::options_description'

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 >.

jon

-- 
"Nothing is true. Everything is permissible."
	- Hassan i Sabbah

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk