|
From: James C. <mr...@gm...> - 2006-06-15 14:25:17
|
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
>
>
>
|