I already tried first rename, but gives me the same error with a different iterator name:

Error 4 error C2084: function 'VALUE _wrap_IteratorImpl_next(int,VALUE *,VALUE)' already has a body C:\dev\bug1132937\build\swig\ruby\zorba_apiRUBY_wrap.cxx 11753 1 Ruby

second rename compiles, but, can you tell me which iterator are we talking about here? is this the std::iterator? or api iterator?

-Rodolfo



On Fri, Mar 22, 2013 at 4:14 PM, William S Fulton <wsf@fultondesigns.co.uk> wrote:
The following small test replicates the problem. It contains a solution with the %rename too...

%rename(ZorbaIterator) ::Iterator;

%include <std_vector.i>

%template(VectorInt) std::vector<int>;

%inline %{
std::vector<int> vvv(std::vector<int> v) {
  return v;
}
struct Item {};
struct Iterator {
  bool next(Item *) {}
};
%}

Hopefully you can use this %rename, otherwise:

%rename(SwigIterator) swig::Iterator;

should work.

William


On 22/03/13 01:06, Rodolfo Ochoa wrote:
here...

Error4error C2084: function 'VALUE _wrap_Iterator_next(int,VALUE
*,VALUE)' already has a
bodyC:\dev\bug1132937\build\swig\ruby\zorba_apiRUBY_wrap.cxx117531Ruby

Error3error C2086: 'swig_class SwigClassIterator' :
redefinitionC:\dev\bug1132937\build\swig\ruby\zorba_apiRUBY_wrap.cxx114521Ruby


https://www.dropbox.com/s/8vf993q2nvc81i6/zorba_apiRUBY_wrap.cxx

thanks,
Rodolfo


On Thu, Mar 21, 2013 at 6:59 PM, Rodolfo Ochoa <rodolfo.ochoa@gmail.com
<mailto:rodolfo.ochoa@gmail.com>> wrote:

    here...

    Error4error C2084: function 'VALUE _wrap_Iterator_next(int,VALUE
    *,VALUE)' already has a
    bodyC:\dev\bug1132937\build\swig\ruby\zorba_apiRUBY_wrap.cxx117531Ruby

    Error3error C2086: 'swig_class SwigClassIterator' :
    redefinitionC:\dev\bug1132937\build\swig\ruby\zorba_apiRUBY_wrap.cxx114521Ruby





    On Thu, Mar 21, 2013 at 6:27 PM, William S Fulton
    <wsf@fultondesigns.co.uk <mailto:wsf@fultondesigns.co.uk>> wrote:




        On 21 March 2013 21:49, Klaus Kaempf <kkaempf@suse.de
        <mailto:kkaempf@suse.de>> wrote:

            * Rodolfo Ochoa <rodolfo.ochoa@gmail.com
            <mailto:rodolfo.ochoa@gmail.com>> [Mar 21. 2013 22:02]:

             > - download and unpack zorba
             > - go to swig
             > - edit zorba_api.i
             > - comment:
             > 30: #ifndef SWIGRUBY
             > 32: #endif
             >
             > so, now std_vector.i is included with Ruby
             > try building after that...

            LOL - yeah, now fails also for me.

            It looks like a name clash to me. Zorba and Swig define an
            'Iterator'
            class. My Swig knowledge is insufficient to come up with a quick
            solution, however.

        Can you post zorba_apiRUBY_wrap.cxx online somewhere along with
        the matching compiler error including line numbers and I'll take
        a quick look? Is the Zorba Iterator class in a namespace, or can
        you point me to the class declaration?

        William