|
From: Ratko J. <rja...@gm...> - 2006-06-15 14:38:05
|
Well, I have no idea what that means. A little bit of code should help (.i,
.h and .cpp).
I am just a beginner in this as well and I got maps wrapped like this with
success. What version of swig are you using? I was using the latest one...
Ratko
On 6/15/06, James Carroll <mr...@gm...> wrote:
>
> Thanks Ratko,
>
> When I do that, it gives me the following errors, I've tried adding
> %include "exception.i" but that doesn't help.
>
> gen\bright_wrap.cpp(11907) : error C2065: 'SWIG_IndexError' :
> undeclared identifier
> gen\bright_wrap.cpp(11907) : error C3861: 'SWIG_exception': identifier
> not found, even with argument-dependent lookup
> gen\bright_wrap.cpp(11971) : error C3861: 'SWIG_exception': identifier
> not found, even with argument-dependent lookup
> gen\bright_wrap.cpp(11971) : error C3861: 'SWIG_IndexError':
> identifier not found, even with argument-dependent lookup
> gen\bright_wrap.cpp(12020) : error C3861: 'SWIG_exception': identifier
> not found, even with argument-dependent lookup
> gen\bright_wrap.cpp(12020) : error C3861: 'SWIG_IndexError':
> identifier not found, even with argument-dependent lookup
> B
>
> Thanks,
> -Jim
>
>
>
>
> On 6/15/06, Ratko Jagodic <rja...@gm...> wrote:
> > Use something like this:
> > %include "std_map.i"
> >
> > %template() std::pair<std::string, std::string>;
> > %template(String_StringMap) std::map<std::string, std::string>;
> > // no typedef!
> >
> > and then in your source use
> > class GraphProperty
> > {
> > public:
> > const map<string, string> GetProperties();
> >
> >
> >
> >
> >
> > On 6/15/06, James Carroll < mr...@gm...> wrote:
> > >
> > Hi I'm wrapping some C++ for python, and using stl::map.
> >
> > So far I have:
> >
> > %import stl.i
> >
> > //%template() std::pair<std::string, std::string>;
> > //%template(String_StringMap) std::map<std::string, std::string>;
> >
> > typedef std::map<std::string, std::string> String_StringMap;
> >
> > class GraphProperty
> > {
> > public:
> > const String_StringMap& GetProperties();
> > ....
> >
> > ( I've tried it with and without the %template declarations. Using
> > them gives me compile errors when my generated wrapper code is
> > compiled.)
> >
> > What happens here is:
> >
> > d = bright.Graph()
> > d.GetProperties()
> > <Swig Object at
> >
> _145fd601_p_std__mapTstd__string_std__string_std__lessTstd__string_t_std__allocatorTstd__pairTstd__string_const_std__string_t_t_t>
> >
> >
> > How do I make this work?
> > Thanks,
> > -Jim
> >
> >
> > _______________________________________________
> > Swig-user mailing list
> > Swi...@li...
> > https://lists.sourceforge.net/lists/listinfo/swig-user
> >
> >
> >
> >
> > _______________________________________________
> > Swig-user mailing list
> > Swi...@li...
> > https://lists.sourceforge.net/lists/listinfo/swig-user
> >
> >
> >
>
|