[Dev] PyLucene Question]

darryl developer at csrules.dyndns.org
Sat May 29 23:50:12 PDT 2004

Andi Vajda wrote:

>The compiler complains because swig generated a constructor for an abstract
>class. The trick is to wrap the swig declaration of the class with %nodefault;
>%makedefault;. See the PyLucene.i file for other examples and the swig
>documentation for more details.
>So I added the IndexReader class and the classes it needed such as Term,
>TermDocs, TermEnum and TermPositions. I removed the methods using arrays and
>::java::util::Collection because I haven't written type conversion routines
>for those yet.
>The thing that stumped me though are the delete methods on IndexReader.
>Because 'delete' is a keyword in C++, gcjh renames these methods to 'delete$',
>something python and swig don't like so I used %rename for the python/swig
>side and renamed 'delete$' to 'deleteTerm' but there still is a dynamic linker
>problem later on though as the 'delete$' methods are not correctly resolved:
>undefined symbols:
> org::apache::lucene::index::IndexReader::delete$(org::apache::lucene::index::Term*)
> org::apache::lucene::index::IndexReader::delete$(int)
>There are relevant, yet slightly different delete$ symbols in _PyLucene.so
>though, so there could be a bug in gcc/gcj and the linker here.
>Any idea on how to solve that one would be welcome.
>These latest changes are checked in, with the additions untested. I checked it
>in so that you could proceed and elucidate the 'delete' riddle :)
>(The 'delete$' methods are commented out).

Ah, I knew the %nodefault trick but just realized i had it on the wrong 
side of a '}'

Thanks for taking a look at this, trying to build now to see what happens...



More information about the Dev mailing list