Boost logo

Boost :

From: tom-list_at_[hidden]
Date: 2001-03-28 17:50:39


--- In boost_at_y..., "David Abrahams" <abrahams_at_m...> wrote:
>
> ----- Original Message -----
> From: "Tom Malcolmson" <tom-list_at_h...>
>
> > I'm using VC6 SP4 on Win2K SP1, with:
> > Boost 1.21.1 with Python 2.0.
> > Dinkum STL (the bundled version)
> > wxWindows 2.2.5
> >
> > I add the following line to my Win32 DLL:
> > #include <boost/python/class_builder.hpp>
> >
> > This causes the following error msg:
> > e:\devcode\boost\boost\python\classes.hpp(379) : error
C2955: 'modulus' :
> > use of class template requires template argument list
> > e:\devapps\vstudio\vc98\include\functional(57) : see
declaration
> of
> > 'modulus'
> >
> > The line referenced in the error msg (from classes.hpp) is:
> > template <class T> PyObject* class_t<T>::instance_number_power
(PyObject*
> > obj, PyObject* exponent, PyObject* modulus) const
> >
> > Modulus is defined in 'functional' (which is included by map in
my STL),
> by
> > why isn't it protected by a namespace? I fixed the problem by
renaming
> > 'modulus' (then everything works fine), but this is obviously not
a good
> > solution.
>
> Do you have "using namespace std" somewhere? There shouldn't be a
name
> conflict at all, but it seems likely that VC6 would give you
problems if you
> had employed a using-directive. I suggest a grep through the
preprocessed
> source file.

Quite right!
There is a 'using namespace std;' in the wxWindows source (it is used
to access the standard iostreams library instead of wxWindows' own
iostreams).

That's the explanation, but I guess there is no real solution to
this, so I'll work around it somehow.
I'll post a message to the wxWindows newsgroup notifying them of this
conflict.

Thanks for your help, and congratulations on the success of the boost
python library.

Tom.

> > Tinkering around I find that I can get it to compile if I cut out
the
> > wxWindows library, but the wxWindows library doesn't use the
namespaces or
> > the STL in any way.
>
> Hmm. I can imagine that one way it goes is: wxwindows #includes
<stdio.h>,
> which looks like #include <cstdio> + using namespace std;
>
> > I'm not expecting anyone to have experience with this particular
combo of
> > libraries, but I'm wondering if you've experienced something like
this?
> Or
> > is there something obvious that I'm missing?
> >
> > (BTW, I am familiar with STLport, and I consider it superior to
Dinkum,
> but
> > I'm currently having some other problems with it and it wouldn't
help with
> > this problem anyway.)
>
> Well, it might, if my theory about "using namespace std" were
correct.
> STLport puts everything in namespace _STL or _STLD
>
> -Dave


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