Jarrod Roberson
2007-Jun-11 19:33 UTC
[Xapian-discuss] trying to build and use the java-swig bindings with 1.0.1
I am trying to get the java-swig bindings to build for using 1.0.1 on OSX 10.4.9. here is the output I am getting. dhcp-102-182:~/CPP/xapian-bindings-1.0.1/java-swig>makemake all-am if /bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/System/Library/Frameworks/JavaVM.framework/Headers -fno-strict-aliasing -Wall -Wno-unused -Wno-uninitialized -fvisibility=hidden -I/usr/local/include -g -O2 -MT xapian_wrap.lo -MD -MP -MF ".deps/xapian_wrap.Tpo" -c -o xapian_wrap.lo xapian_wrap.cc; \ then mv -f ".deps/xapian_wrap.Tpo" ".deps/xapian_wrap.Plo"; else rm -f ".deps/xapian_wrap.Tpo"; exit 1; fi mkdir .libs g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/System/Library/Frameworks/JavaVM.framework/Headers -fno-strict-aliasing -Wall -Wno-unused -Wno-uninitialized -fvisibility=hidden -I/usr/local/include -g -O2 -MT xapian_wrap.lo -MD -MP -MF .deps/xapian_wrap.Tpo -c xapian_wrap.cc -fno-common -DPIC -o .libs/xapian_wrap.o /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++ 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); ^ ./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
Olly Betts
2007-Jun-11 22:53 UTC
[Xapian-discuss] trying to build and use the java-swig bindings with 1.0.1
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