Re: [Ikvm-developers] Qt Jambi on IKVM
Brought to you by:
jfrijters
|
From: Jon C. <jo...@gm...> - 2006-11-09 12:59:40
|
Hi Jeroen, First, thanks for the work on ikvm. The fact this is *possible* is very cool. A google or two found some hits with questions about stdcall vs. cdecl with JNI. From what I gather (if information on internet is reliable ;-) ), JNI should be stdcall on windows *but* alot of links state that the JVM is looking for unmangled names anyway. This can be accomplished via a def file in VS, or a flag on gcc. So, I'm wondering if the undecorated names in com_trolltech_qt_core.dll are still stdcall. Would undecorated names cause a problem for the IKVM JNI layer? If not, any other thoughts? I'm willing to track this down myself with some direction. It seems from the output that the library was loaded, was the symbol resolved? I'm trying to find out what the exact error is. Thnaks Alot, Jonathan On 11/9/06, Jeroen Frijters <je...@su...> wrote: > > 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=42da1751-bf3e-44df-a43a-e198d > 6a26c06 > > Regards, > Jeroen > > > -----Original Message----- > > From: ikv...@li... > > [mailto:ikv...@li...] On > > Behalf Of Jon Chambers > > Sent: Thursday, November 09, 2006 02:50 > > To: ikv...@li... > > Subject: [Ikvm-developers] Qt Jambi on IKVM > > > > Hi everyone, > > I am trying out Qt Jambi > > (http://www.trolltech.com/developer/downloads/qt/qtjambi-techp > > review) on IKVM. These are official Java bindings from > > Trolltech that are about to be released; they are at their > > final technology preview right now. Anyway, I wrote a sample > > app that works great under ikvm.exe. However, my goal is > > really to use Qt from C#. So, I compiled the qtjambi.jar file > > with ikvmc, and got an assembly. I wrote my app in C# an > > everything built. However, when I run my app I get the > > following error (note I got some debug tracing by adding > > IKVM.Internal.Tracer.EnableTraceForDebug () to the beginning > > of my app). I think the JNI method in question resides in > > com_trolltech_qt_core.dll which seems to get loaded. If this > > is a problem in qtjambi, I'll like to let them know before > > the final release; it would be very cool if IKVM could help > > get C# bindings from the java ones. But again my app runs > > fine on ikvm, so I'm guessing it's something specific to > > ikvmc? Any help/direction would be appreciated. > > > > Thanks, > > Jonathan Chambers > > > > C:\eclipse\QtJambiTest\bin\Debug>QtJambiTest.exe > > [20:41:25.20312 ] Core assembly: > > C:\eclipse\QtJambiTest\bin\Debug\IKVM.GNU.Class > > path.dll > > [20:41:25.20312 ] Remapping type System.Exception to > > java.lang.Throwable > > [20:41:25.20312 ] Remapping type System.IComparable to > > 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: > > C:\eclipse\QtJambiTest\bin\Debug\QtCore4.dll, cla > > ss loader: java.lang.ClassLoader$1@2004EEE > > [20:41:25.62500 ] loadLibrary: > > C:\eclipse\QtJambiTest\bin\Debug\qtjambi.dll, cla > > ss loader: java.lang.ClassLoader$1@2004EEE > > [20:41:25.62500 ] loadLibrary: > > C:\eclipse\QtJambiTest\bin\Debug\QtCore4.dll, cla > > ss loader: java.lang.ClassLoader$1@2004EEE > > [20:41:25.62500 ] loadLibrary: > > C:\eclipse\QtJambiTest\bin\Debug\QtGui4.dll, clas > > s loader: java.lang.ClassLoader$1@2004EEE > > [20:41:25.62500 ] loadLibrary: > > C:\eclipse\QtJambiTest\bin\Debug\com_trolltech_qt > > _core.dll, class loader: java.lang.ClassLoader$1@2004EEE > > [20:41:25.64062 ] Linking native method: > > com/trolltech/qt/core/QtJambi_LibraryIn > > itializer.__qt_initLibrary()V, class loader = > > java.lang.ClassLoader$1@2004EEE, s > > hort = > > Java_com_trolltech_qt_core_QtJambi_1LibraryInitializer__1_1qt_ > > 1initLibrar > > y, long = > > Java_com_trolltech_qt_core_QtJambi_1LibraryInitializer__1_1qt_ > > 1initLib > > rary__, args = 8 > > [20:41:25.64062 ] UnsatisfiedLinkError: > > com/trolltech/qt/core/QtJambi_LibraryIni > > tializer.__qt_initLibrary()V > > > > Unhandled Exception: System.TypeInitializationException: The > > type initializer fo > > r 'com.trolltech.qt.gui.QApplication' threw an exception. > > ---> System.TypeInitia > > lizationException: The type initializer for > > 'com.trolltech.qt.core.QCoreApplicat > > ion' threw an exception. ---> > > System.TypeInitializationException : The type initi > > alizer for 'com.trolltech.qt.core.QObject' threw an > > exception. ---> System.TypeI > > nitializationException: The type initializer for > > 'com.trolltech.qt.QtObject' thr > > ew an exception. ---> System.TypeInitializationException : > > The type initializer f > > or 'com.trolltech.qt.QtJambi_LibraryInitializer' threw an > > exception. ---> System > > .TypeInitializationException: The type initializer for > > 'com.trolltech.qt.QClassP > > athFileEngineHandler' threw an exception. ---> > > System.TypeInitializationExceptio > > n: The type initializer for > > 'com.trolltech.qt.core.QAbstractFileEngineHandler' t > > hrew an exception. ---> System.TypeInitializationException: > > The type initializer > > for 'com.trolltech.qt.core.QtJambi_LibraryInitializer ' > > threw an exception. ---> > > java.lang.UnsatisfiedLinkError: > > 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 --- > > 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) > > at QtJambiTest.Program.Main(String[] args) in > > C:\eclipse\QtJambiTest\Program. > > cs:line 13 > > > > > |