[Xapian-discuss] trying to build and use the java-swig bindings with 1.0.1

Jarrod Roberson jarrod at vertigrated.com
Tue Jun 12 20:02:32 BST 2007


On 6/11/07, Olly Betts <olly at survex.com> wrote:
>
> On Mon, Jun 11, 2007 at 02:33:45PM -0400, Jarrod Roberson wrote:
> > /bin/sh ../libtool --tag=CXX --mode=link g++ -fno-strict-aliasing -Wall
> > -Wno-unused -Wno-uninitialized -fvisibility=hidden -I/usr/local/include
> -g
> > -O2   -o libxapian_jni.la -rpath `pwd`/built -avoid-version -module
> > xapian_wrap.lo /usr/local/lib/libxapian.la -lstdc++
> > g++ ${wl}-undefined ${wl}dynamic_lookup -o .libs/libxapian_jni.so
> -bundle
> > .libs/xapian_wrap.o  /usr/local/lib/libxapian.dylib -lstdc++
>
> The `${wl}' bits look suspicious, but maybe they are expanded OK when
> the command is actually run.  If you run these commands by hand, does
> that help:
>
> g++ -Wl,-undefined -Wl,dynamic_lookup -o .libs/libxapian_jni.so -bundle
> .libs/xapian_wrap.o  /usr/local/lib/libxapian.dylib -lstdc++
> touch libxapian_jni.la
> make


I tried running those commands and here is the output.
dhcp-102-182:~/cpp/xapian-bindings-1.0.1/java-swig
>g++ -Wl,-undefined -Wl,dynamic_lookup -o .libs/libxapian_jni.so -bundle
.libs/xapian_wrap.o  /usr/local/lib/libxapian.dylib -lstdc++
dhcp-102-182:~/cpp/xapian-bindings-1.0.1/java-swig
>touch libxapian_jni.la
dhcp-102-182:~/cpp/xapian-bindings-1.0.1/java-swig
>make
make  all-am
/usr/bin/javac -classpath .:. -d . Auto.java
./XapianJNI.java:351: cannot find symbol
symbol  : class ValueRangeProcessor
location: class XapianJNI
  public final static native long ValueRangeProcessor_apply(long jarg1,
ValueRangeProcessor jarg1_, long jarg2, long jarg3);
                                                                        ^
./XapianJNI.java:353: cannot find symbol
symbol  : class StringValueRangeProcessor
location: class XapianJNI
  public final static native long StringValueRangeProcessor_apply(long
jarg1, StringValueRangeProcessor jarg1_, long jarg2, long jarg3);

^
./XapianJNI.java:358: cannot find symbol
symbol  : class DateValueRangeProcessor
location: class XapianJNI
  public final static native long DateValueRangeProcessor_apply(long jarg1,
DateValueRangeProcessor jarg1_, long jarg2, long jarg3);

^
./XapianJNI.java:363: cannot find symbol
symbol  : class NumberValueRangeProcessor
location: class XapianJNI
  public final static native long NumberValueRangeProcessor_apply(long
jarg1, NumberValueRangeProcessor jarg1_, long jarg2, long jarg3);

^
./XapianJNI.java:390: cannot find symbol
symbol  : class ValueRangeProcessor
location: class XapianJNI
  public final static native void QueryParser_addValuerangeprocessor(long
jarg1, QueryParser jarg1_, long jarg2, ValueRangeProcessor jarg2_);

^
./QueryParser.java:103: cannot find symbol
symbol  : class ValueRangeProcessor
location: class QueryParser
  public void addValuerangeprocessor(ValueRangeProcessor vrproc) {
                                     ^
./QueryParser.java:104: cannot find symbol
symbol  : variable ValueRangeProcessor
location: class QueryParser
    XapianJNI.QueryParser_addValuerangeprocessor(swigCPtr, this,
ValueRangeProcessor.getCPtr(vrproc), vrproc);
                                                                 ^
7 errors
make[1]: *** [Auto.class] Error 1
make: *** [all] Error 2



> creating libxapian_jni.la
> > (cd .libs && rm -f libxapian_jni.la && ln -s ../libxapian_jni.la
> > libxapian_jni.la)
> > /usr/bin/javac -classpath .:. -d . Auto.java
> > ./XapianJNI.java:351: cannot find symbol
> > symbol  : class ValueRangeProcessor
> > location: class XapianJNI
> >  public final static native long ValueRangeProcessor_apply(long jarg1,
> > ValueRangeProcessor jarg1_, long jarg2, long jarg3);
> >                                                                        ^
>
> I just tried this myself on Linux, but I get a different error.  In
> class DateValueRangeProcessor, one of the constructors (in Java) takes
> (long, boolean), which collides with the protected SWIG constructor
> taking the same arguments.  That's a bug in SWIG really - it's
> currently impossible to wrap a class with a C++ constructor taking
> parameters (unsigned long, bool) it would appear.
>
> Perhaps your error has the same cause, but you're using a different
> compiler.


I am running the version of gcc that the most recent version of Xcode ships
with 4.x

If you edit the generated DataValueRangeProcessor.java file by hand and
> just delete this constructor entirely, does "make" complete?
>
>   public DataValueRangeProcessor(long valno_, boolean prefer_mdy_) {
>     this(XapianJNI.new_DateValueRangeProcessor__SWIG_1(valno_,
> prefer_mdy_), true);
>   }
>
> Cheers,
>     Olly
>

I can't find a java source file called DateValueRangeProcessor.java

here is a list of all the files in java-swig

dhcp-102-182:~/cpp/xapian-bindings-1.0.1/java-swig
>dir
total 564
1302609 drwxr-xr-x   47 jhr  jhr      1K Jun 12 14:56 ./
1302453 drwxr-xr-x   43 jhr  jhr      1K Jun 11 15:01 ../
1306259 drwxr-xr-x    3 jhr  jhr    102B Jun 12 14:56 .deps/
1309742 drwxr-xr-x    6 jhr  jhr    204B Jun 12 14:59 .libs/
1302616 -rw-r--r--    1 jhr  jhr    997B Jun 10 23:36 Auto.java
1302618 -rw-r--r--    1 jhr  jhr      2K Jun 10 23:36 BM25Weight.java
1302617 -rw-r--r--    1 jhr  jhr      2K Jun 10 23:36 BoolWeight.java
1302619 -rw-r--r--    1 jhr  jhr      3K Jun 10 23:36 Database.java
1302620 -rw-r--r--    1 jhr  jhr      3K Jun 10 23:36 Document.java
1302623 -rw-r--r--    1 jhr  jhr      1K Jun 10 23:36 ESet.java
1302624 -rw-r--r--    1 jhr  jhr      1K Jun 10 23:36 ESetIterator.java
1302621 -rw-r--r--    1 jhr  jhr      8K Jun 10 23:36 Enquire.java
1302622 -rw-r--r--    1 jhr  jhr      1K Jun 10 23:36 ExpandDecider.java
1302625 -rw-r--r--    1 jhr  jhr      1K Jun 10 23:36 Flint.java
1302626 -rw-r--r--    1 jhr  jhr   1006B Jun 10 23:36 InMemory.java
1302628 -rw-r--r--    1 jhr  jhr      3K Jun 10 23:36 MSet.java
1302629 -rw-r--r--    1 jhr  jhr      2K Jun 10 23:36 MSetIterator.java
1306222 -rw-r--r--    1 jhr  jhr     21K Jun 11 13:41 Makefile
1302610 -rw-r--r--    1 jhr  jhr      3K Jun 10 23:06 Makefile.am
1302611 -rw-r--r--    1 jhr  jhr     22K Jun 10 23:09 Makefile.in
1302627 -rw-r--r--    1 jhr  jhr      1K Jun 10 23:36 MatchDecider.java
1302630 -rw-r--r--    1 jhr  jhr      1K Jun 10 23:36 PositionIterator.java
1302631 -rw-r--r--    1 jhr  jhr      2K Jun 10 23:36 PostingIterator.java
1302632 -rw-r--r--    1 jhr  jhr      1K Jun 10 23:36 Quartz.java
1302633 -rw-r--r--    1 jhr  jhr      5K Jun 10 23:36 Query.java
1302634 -rw-r--r--    1 jhr  jhr      7K Jun 10 23:36 QueryParser.java
1302636 -rw-r--r--    1 jhr  jhr      1K Jun 10 23:36 RSet.java
1302635 -rw-r--r--    1 jhr  jhr      2K Jun 10 23:36 Remote.java
1302637 -rw-r--r--    1 jhr  jhr      1K Jun 10 23:36 SimpleStopper.java
1302614 -rw-r--r--    1 jhr  jhr      4K Jun 10 23:06 SmokeTest.java
1302638 -rw-r--r--    1 jhr  jhr      1K Jun 10 23:36 Stem.java
1302639 -rw-r--r--    1 jhr  jhr      1K Jun 10 23:36 Stopper.java
1302640 -rw-r--r--    1 jhr  jhr      2K Jun 10 23:36 TermGenerator.java
1302641 -rw-r--r--    1 jhr  jhr      2K Jun 10 23:36 TermIterator.java
1302642 -rw-r--r--    1 jhr  jhr      2K Jun 10 23:36 TradWeight.java
1302643 -rw-r--r--    1 jhr  jhr      1K Jun 10 23:36 ValueIterator.java
1302644 -rw-r--r--    1 jhr  jhr      1K Jun 10 23:36 Version.java
1302645 -rw-r--r--    1 jhr  jhr      1K Jun 10 23:36 Weight.java
1302646 -rw-r--r--    1 jhr  jhr      2K Jun 10 23:36 WritableDatabase.java
1302647 -rw-r--r--    1 jhr  jhr    871B Jun 10 23:36 Xapian.java
1302648 -rw-r--r--    1 jhr  jhr    709B Jun 10 23:36 XapianConstants.java
1302649 -rw-r--r--    1 jhr  jhr     38K Jun 10 23:36 XapianJNI.java
1309752 -rw-r--r--    1 jhr  jhr    888B Jun 12 14:59 libxapian_jni.la
1302613 -rwxr-xr-x    1 jhr  jhr    294B Jun 10 23:06 run-java-test
1302612 -rw-r--r--    1 jhr  jhr    298K Jun 10 23:36 xapian_wrap.cc
1302615 -rw-r--r--    1 jhr  jhr      2K Jun 10 23:36 xapian_wrap.h
1309740 -rw-r--r--    1 jhr  jhr    313B Jun 12 14:56 xapian_wrap.lo

the only references I can find to DateValueRangeProcessor is in the
XapianJNI.java file.


More information about the Xapian-discuss mailing list