RE: [Quickfix-developers] JNI dynamic linking problems on Solaris
Brought to you by:
orenmnero
From: Chuck H. <zzc...@xc...> - 2003-03-12 16:12:20
|
Ah, my apologies. I misread your earlier email and actually moved my = libtools backward from 1.4 to 1.3.x (also partly because there seem to = be incompatibilities between the latest sunfreeware autoconf, automake, = libtools). I've now been able to build and test the JNI shared library without = STLport (with STLport I get a runtime link error, see below). Here's the setup I'm using: Software Setup: OS: Solaris 8 Packages: <various utilities: gnu tar, gnu make, etc> SMCautoc autoconf (sparc) 2.13 SMCautom automake (sparc) 1.4 SMCbinut binutils (sparc) 2.11.2 SMCgawk gawk (sparc) 3.0.4 SMCgcc gcc (sparc) 2.95.3 SMClibt libtool (sparc) 1.4 SMCm4 m4 (sparc) 1.4 (note SMCbinutil and SMCgcc have conflicting files, so I installed with = overwriting in the order SMCbinutil, SMCgcc) Environment: export JAVA_HOME=3D<JDK path> PATH=3D$JAVA_HOME/bin:/usr/local/bin:$PATH Steps: Unpack libxml2-2.4.30 Unpack quickfix-1.4 In libxml2-2.4.30: ./configure make sudo make install In quickfix: ./bootstrap ./configure make sudo make install In quickfix/examples: ./bootstrap ./configure make With STLport, I get a runtime link error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=3D0xF1A73F54 Function=3D__Q24_STL6locale+0x24 Library=3D/usr/local/lib/libstlport_gcc.so - Chuck -----Original Message----- From: Oren Miller [mailto:ore...@ya...] Sent: Monday, March 10, 2003 3:18 PM To: Chuck Houpt; qui...@li... Subject: RE: [Quickfix-developers] JNI dynamic linking problems on Solaris As I posted earlier, I believe this is because of an older version of libtool. Run 'libtool --version' on your command line. If it reports a version earlier that 1.4, than you should upgrade, then run the ./bootstrap script Earlier versions would not allow you to link a static library into a shared object, which is what we are attempting to do here by linking quickfix and gcc int quickfix_jni. --- Chuck Houpt <zzc...@xc...> wrote: > I tried adding -lgcc, but libtool complains that it > doesn't exist (it exists as a static library down in > /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3). > Do I need a shared library version of libgcc.a? > Below is the libtools call. > =20 > Thanks - Chuck > =20 > /bin/sh ../../libtool --mode=3Dlink c++ -fexceptions > -Wall -I/usr/local/include/s > tlport -I/usr/local/include/libxml2 > -I/usr/j2se/include -I/usr/j2se/include/sol > aris -o libquickfix_jni.la -rpath /usr/local/lib > -version-info 0:1:0 JVM.lo Con > versions.lo JavaApplication.lo JavaLog.lo > JavaLogFactory.lo JavaMessageStore.lo > JavaMessageStoreFactory.lo org_quickfix_FileStore.lo > org_quickfix_FileStoreFacto > ry.lo org_quickfix_FileLog.lo > org_quickfix_FileLogFactory.lo org_quickfix_Group. > lo org_quickfix_MemoryStore.lo > org_quickfix_Message.lo org_quickfix_MySQLStore.l > o org_quickfix_MySQLStoreFactory.lo > org_quickfix_MySQLLog.lo org_quickfix_MySQLL > ogFactory.lo org_quickfix_ScreenLog.lo > org_quickfix_ScreenLogFactory.lo org_quic > kfix_Session.lo org_quickfix_SessionID.lo > org_quickfix_Settings.lo org_quickfix_ > SocketAcceptor.lo org_quickfix_SocketInitiator.lo > org_quickfix_ThreadedSocketAcc > eptor.lo org_quickfix_ThreadedSocketInitiator.lo > -L../../src/C++ -lquickfix -lst > dc++ -lgcc -L/usr/local/lib -lstlport_gcc > -L/usr/local/lib -R/usr/local/lib -lxm > l2 -lz -lm -lsocket -lnsl -liberty > rm -fr .libs/libquickfix_jni.la > .libs/libquickfix_jni.* .libs/libquickfix_jni.* > =20 > *** Warning: This library needs some functionality > provided by -lquickfix. > *** I have the capability to make that library > automatically link in when > *** you link to this library. But I can only do > this if you have a > *** shared version of the library, which you do not > appear to have. > =20 > *** Warning: This library needs some functionality > provided by -lgcc. > *** I have the capability to make that library > automatically link in when > *** you link to this library. But I can only do > this if you have a > *** shared version of the library, which you do not > appear to have. > *** The inter-library dependencies that have been > dropped here will be > *** automatically added whenever a program is linked > with this library > *** or is declared to -dlopen it. > /usr/ccs/bin/ld -G -h libquickfix_jni.so.0 -o > .libs/libquickfix_jni.so.0.0.1 JV > M.lo Conversions.lo JavaApplication.lo JavaLog.lo > JavaLogFactory.lo JavaMessageS > tore.lo JavaMessageStoreFactory.lo > org_quickfix_FileStore.lo org_quickfix_FileSt > oreFactory.lo org_quickfix_FileLog.lo > org_quickfix_FileLogFactory.lo org_quickfi > x_Group.lo org_quickfix_MemoryStore.lo > org_quickfix_Message.lo org_quickfix_MySQ > LStore.lo org_quickfix_MySQLStoreFactory.lo > org_quickfix_MySQLLog.lo org_quickfi > x_MySQLLogFactory.lo org_quickfix_ScreenLog.lo > org_quickfix_ScreenLogFactory.lo > org_quickfix_Session.lo org_quickfix_SessionID.lo > org_quickfix_Settings.lo org_q > uickfix_SocketAcceptor.lo > org_quickfix_SocketInitiator.lo > org_quickfix_ThreadedS > ocketAcceptor.lo > org_quickfix_ThreadedSocketInitiator.lo=20 > -L../../src/C++ -lstdc > ++ -L/usr/local/lib -lstlport_gcc -lxml2 -lz -lm > -lsocket -lnsl -liberty -lc > (cd .libs && rm -f libquickfix_jni.so.0 && ln -s > libquickfix_jni.so.0.0.1 libqui > ckfix_jni.so.0) > (cd .libs && rm -f libquickfix_jni.so && ln -s > libquickfix_jni.so.0.0.1 libquick > fix_jni.so) > ar cru .libs/libquickfix_jni.a JVM.o Conversions.o > JavaApplication.o JavaLog.o > JavaLogFactory.o JavaMessageStore.o > JavaMessageStoreFactory.o org_quickfix_FileS > tore.o org_quickfix_FileStoreFactory.o > org_quickfix_FileLog.o org_quickfix_FileL > ogFactory.o org_quickfix_Group.o > org_quickfix_MemoryStore.o org_quickfix_Message > .o org_quickfix_MySQLStore.o > org_quickfix_MySQLStoreFactory.o org_quickfix_MySQL > Log.o org_quickfix_MySQLLogFactory.o > org_quickfix_ScreenLog.o org_quickfix_Scree > nLogFactory.o org_quickfix_Session.o > org_quickfix_SessionID.o org_quickfix_Setti > ngs.o org_quickfix_SocketAcceptor.o > org_quickfix_SocketInitiator.o org_quickfix_ > ThreadedSocketAcceptor.o > org_quickfix_ThreadedSocketInitiator.o > ranlib .libs/libquickfix_jni.a > creating libquickfix_jni.la > (cd .libs && rm -f libquickfix_jni.la && ln -s > ../libquickfix_jni.la libquickfix > _jni.la) > rm -f ../../lib/libquickfix_jni.so > ln -s ../src/java/.libs/libquickfix_jni.so > ../../lib/libquickfix_jni.so >=20 > -----Original Message----- > From: Oren Miller [mailto:ore...@ya...] > Sent: Friday, March 07, 2003 5:56 PM > To: Chuck Houpt; > qui...@li... > Subject: Re: [Quickfix-developers] JNI dynamic > linking problems on Solaris >=20 >=20 >=20 > You should be able to fix this by adding -lgcc to > the libquickfix_jni_la_LIBADD line in the src/java > Makefile.am. You will then need to relink.=20 >=20 >=20 > Chuck Houpt <zzc...@xc...> wrote:=20 >=20 >=20 > Thanks to Bud and Oren, I've got quickfix > bootstrapped, configure, build and installed on > Solaris (gcc 2.95.3+stlport). The cpp programs seem > to run fine, but I'm still having trouble getting > the java programs to run. >=20 > I'm now getting the same error messages that Gary > Mui was seeing in October. Was a solution to this > found? >=20 > Thanks - Chuck >=20 > From:=20 > trouble running JNI example on Solaris=20 > 2002-10-30 14:22=20 >=20 > I seem to be having some problems with JNI under > Solaris. >=20 > I think I got everything compiled successfully and I > can run the C++ > version of executor. But when I try running the java > version, I get the > following: >=20 > Exception in thread "main" > java.lang.UnsatisfiedLinkError: > /u03/export/home/gmui/build/quickfix/src/java/.libs/libquickfix_jni.so.0.= > 0.1: ld.so.1: > /usr/bin/../java/bin/../bin/sparc/native_threads/java: > fatal: > relocation error: file > /u03/export/home/gmui/build/quick > fix/src/java/.libs/libquickfix_jni.so.0.0.1: symbol > __pure_virtual: > referenced symbol not found > at java.lang.ClassLoader$NativeLibrary.load(Native > Method) > at > java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1419) > at > java.lang.ClassLoader.loadLibrary(ClassLoader.java:1343) > at java.lang.Runtime.loadLibrary0(Runtime.java:749) > at java.lang.System.loadLibrary(System.java:820) > at Executor.(Executor.java:58) >=20 >=20 >=20 __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ |