[C++-sig] Problem compiling V2 tests.

Tim Field Tim.Field at mcs.vuw.ac.nz
Sun Aug 4 05:11:13 CEST 2002


Hi there,

I'm having trouble compiling Boost.Python V2 from the current CVS sources
(using GCC 3.1 on a P4 running NetBSD 1.6D).  I downloaded and tried to
compile the sources as per instructions in:

    http://mail.python.org/pipermail/c++-sig/2002-May/001100.html

While I'm able to compile libbpl.so without any errors, compiling any of
the tests or using it myself gives errors in bases.hpp (which is included
by module.hpp).

For example, if I try compiling this simple file:

---
#include <boost/python/module.hpp>

BOOST_PYTHON_MODULE_INIT(test)
{
    boost::python::module m("test");
}
---

then I get the following output (where I've used [...] to shorten the
lines):

---
g++ -I[...]/boost -I[...]/include/python2.2 -c -o Test.o Test.cpp
In file included from [...]/boost/boost/python/class_fwd.hpp:10,
                 from [...]/boost/boost/python/module.hpp:12,
                 from mine.cpp:1:
[...]/boost/boost/python/bases.hpp:15: parse error before numeric constant
[...]/boost/boost/python/bases.hpp:20: Internal compiler error in
           resume_binding_level, at cp/decl.c:614
Please submit a full bug report, with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
gmake: *** [Test.o] Error 1
---

The preprocessor gives the following output for bases.hpp:

---
namespace boost { namespace python {

  template<typename 0 = ::boost::mpl::null_argument,
           typename B1 = ::boost::mpl::null_argument,
           typename B2 = ::boost::mpl::null_argument,
           [...]
           typename B14 = ::boost::mpl::null_argument>

  struct bases : ::boost::mpl::type_list<0, B1, B2, [...], B14>::type {};

  namespace detail
  {
    template <class T> struct specifies_bases
    {
        static const bool value = false;
    };
    template <class 0, class B1, class B2, [...], class B14>
    struct specifies_bases<bases<0, B1, B2, [...], B14> >
    {
        static const bool value = true;
    };

  [...]
---

Obviously '0' isn't a valid typename, which is causing the error.  It
seems as though bases.hpp exists in two different versions in CVS
(with a different one under the mpl_v2 branch) but I'm not knowledgeable
enough with CVS to work out which versions I need, or how to get them.

Help... please... anyone? :)


Thanks in advance,
Tim (very much looking forward to the release of v2)





More information about the Cplusplus-sig mailing list