[Xapian-discuss] trying to build and use the java-swig bindings
with 1.0.1
Olly Betts
olly at survex.com
Mon Jun 11 22:53:47 BST 2007
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
> 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.
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
More information about the Xapian-discuss
mailing list