Re: [Ikvm-developers] Qt Jambi on IKVM
Brought to you by:
jfrijters
|
From: Jeroen F. <je...@su...> - 2006-11-09 07:33:21
|
Hi Jon, I can't get *any* of the examples/demos included in the preview to work on ikvm. From the looks of it, I'd guess that the various com_trolltech_qt_*.dlls use the wrong calling convention for the exported JNI methods. On Windows, JNI methods need to use the __stdcall calling convention (usually this is done automatically by the JNICALL #define in jni_md.h). For some unfortunate reason __cdecl also appears to work on the Sun JVM, but unfortunately ikvm cannot magically support both. Also see: http://weblog.ikvm.net/PermaLink.aspx?guid=3D42da1751-bf3e-44df-a43a-e198= d 6a26c06 Regards, Jeroen > -----Original Message----- > From: ikv...@li...=20 > [mailto:ikv...@li...] On=20 > Behalf Of Jon Chambers > Sent: Thursday, November 09, 2006 02:50 > To: ikv...@li... > Subject: [Ikvm-developers] Qt Jambi on IKVM >=20 > Hi everyone, > I am trying out Qt Jambi=20 > (http://www.trolltech.com/developer/downloads/qt/qtjambi-techp > review) on IKVM. These are official Java bindings from=20 > Trolltech that are about to be released; they are at their=20 > final technology preview right now. Anyway, I wrote a sample=20 > app that works great under ikvm.exe. However, my goal is=20 > really to use Qt from C#. So, I compiled the qtjambi.jar file=20 > with ikvmc, and got an assembly. I wrote my app in C# an=20 > everything built. However, when I run my app I get the=20 > following error (note I got some debug tracing by adding=20 > IKVM.Internal.Tracer.EnableTraceForDebug () to the beginning=20 > of my app). I think the JNI method in question resides in=20 > com_trolltech_qt_core.dll which seems to get loaded. If this=20 > is a problem in qtjambi, I'll like to let them know before=20 > the final release; it would be very cool if IKVM could help=20 > get C# bindings from the java ones. But again my app runs=20 > fine on ikvm, so I'm guessing it's something specific to=20 > ikvmc? Any help/direction would be appreciated.=20 >=20 > Thanks, > Jonathan Chambers >=20 > C:\eclipse\QtJambiTest\bin\Debug>QtJambiTest.exe > [20:41:25.20312 ] Core assembly:=20 > C:\eclipse\QtJambiTest\bin\Debug\IKVM.GNU.Class > path.dll > [20:41:25.20312 ] Remapping type System.Exception to=20 > java.lang.Throwable > [20:41:25.20312 ] Remapping type System.IComparable to=20 > java.lang.Comparable > [20:41:25.20312 ] Remapping type System.Object to java.lang.Object > [20:41:25.20312 ] Remapping type System.String to java.lang.String > [20:41:25.62500 ] loadLibrary:=20 > C:\eclipse\QtJambiTest\bin\Debug\QtCore4.dll, cla > ss loader: java.lang.ClassLoader$1@2004EEE > [20:41:25.62500 ] loadLibrary:=20 > C:\eclipse\QtJambiTest\bin\Debug\qtjambi.dll, cla=20 > ss loader: java.lang.ClassLoader$1@2004EEE > [20:41:25.62500 ] loadLibrary:=20 > C:\eclipse\QtJambiTest\bin\Debug\QtCore4.dll, cla > ss loader: java.lang.ClassLoader$1@2004EEE > [20:41:25.62500 ] loadLibrary:=20 > C:\eclipse\QtJambiTest\bin\Debug\QtGui4.dll, clas=20 > s loader: java.lang.ClassLoader$1@2004EEE > [20:41:25.62500 ] loadLibrary:=20 > C:\eclipse\QtJambiTest\bin\Debug\com_trolltech_qt > _core.dll, class loader: java.lang.ClassLoader$1@2004EEE > [20:41:25.64062 ] Linking native method:=20 > com/trolltech/qt/core/QtJambi_LibraryIn=20 > itializer.__qt_initLibrary()V, class loader =3D=20 > java.lang.ClassLoader$1@2004EEE, s > hort =3D=20 > Java_com_trolltech_qt_core_QtJambi_1LibraryInitializer__1_1qt_ > 1initLibrar > y, long =3D=20 > Java_com_trolltech_qt_core_QtJambi_1LibraryInitializer__1_1qt_ > 1initLib=20 > rary__, args =3D 8 > [20:41:25.64062 ] UnsatisfiedLinkError:=20 > com/trolltech/qt/core/QtJambi_LibraryIni > tializer.__qt_initLibrary()V >=20 > Unhandled Exception: System.TypeInitializationException: The=20 > type initializer fo=20 > r 'com.trolltech.qt.gui.QApplication' threw an exception.=20 > ---> System.TypeInitia > lizationException: The type initializer for=20 > 'com.trolltech.qt.core.QCoreApplicat > ion' threw an exception. --->=20 > System.TypeInitializationException : The type initi > alizer for 'com.trolltech.qt.core.QObject' threw an=20 > exception. ---> System.TypeI > nitializationException: The type initializer for=20 > 'com.trolltech.qt.QtObject' thr > ew an exception. ---> System.TypeInitializationException :=20 > The type initializer f > or 'com.trolltech.qt.QtJambi_LibraryInitializer' threw an=20 > exception. ---> System > .TypeInitializationException: The type initializer for=20 > 'com.trolltech.qt.QClassP > athFileEngineHandler' threw an exception. --->=20 > System.TypeInitializationExceptio > n: The type initializer for=20 > 'com.trolltech.qt.core.QAbstractFileEngineHandler' t > hrew an exception. ---> System.TypeInitializationException:=20 > The type initializer > for 'com.trolltech.qt.core.QtJambi_LibraryInitializer '=20 > threw an exception. ---> > java.lang.UnsatisfiedLinkError:=20 > com/trolltech/qt/core/QtJambi_LibraryInitialize > r.__qt_initLibrary()V > --- End of inner exception stack trace --- > at com.trolltech.qt.core.QtJambi_LibraryInitializer.init () > at com.trolltech.qt.core.QAbstractFileEngineHandler..cctor() > --- End of inner exception stack trace --- > at com.trolltech.qt.core.QAbstractFileEngineHandler.__<clinit>() > at com.trolltech.qt.QClassPathFileEngineHandler..cctor () > --- End of inner exception stack trace --- > at com.trolltech.qt.QClassPathFileEngineHandler.__<clinit>() > at com.trolltech.qt.QtJambi_LibraryInitializer..cctor() > --- End of inner exception stack trace ---=20 > at com.trolltech.qt.QtJambi_LibraryInitializer.init() > at com.trolltech.qt.QtObject..cctor() > --- End of inner exception stack trace --- > at com.trolltech.qt.QtObject.__<clinit>() > at com.trolltech.qt.core.QObject..cctor () > --- End of inner exception stack trace --- > at com.trolltech.qt.core.QObject.__<clinit>() > at com.trolltech.qt.core.QCoreApplication..cctor() > --- End of inner exception stack trace --- > at com.trolltech.qt.core.QCoreApplication.__<clinit>() > at com.trolltech.qt.gui.QApplication..cctor() > --- End of inner exception stack trace --- > at com.trolltech.qt.gui.QApplication..ctor(String[] strarr)=20 > at QtJambiTest.Program.Main(String[] args) in=20 > C:\eclipse\QtJambiTest\Program. > cs:line 13 >=20 >=20 |