Dear Greg, You may have a look at my example in hello_world_generator example that you will find in the community-port-to-4_6 git repository at
http://qt.gitorious.org/qt-jambi It uses some specifics for Qt 4.6, but it is a really bare bone example on the build files that could be used see how to make java stubs on a separate Qt Widget. Helge Greg Deubler wrote: > Hi All, > > I am trying to deploy a single executable jar that makes use of a c++ > library which has been run through the generator. > > So far I have been successful in creating a single working jar for > linux, but my Windows jar is not cooperating. If QtCore4.dll, > QtGui4.dll, QtSql4.dll, etc. are found in PATH, the jar runs fine. > However, if they are not in PATH, I receive "UnsatisfiedLinkError: Can't > find dependent libraries" when loading my custom library. > > My jar consists of: > qtjambi-deployment.xml > bin\ > com\ > JambiApp.class > > The bin directory contains the qt native libs as well as my library, and > the com directory contains the needed class files. JambiApp.class > contains the main function. > > > My deployment spec is: > > <qtjambi-deploy system="win32"> > > <cache key="sketcher"/> > > <!-- Runtime libraries, automatically loaded... --> > <library name="bin/mingwm10.dll" load="yes" /> > > <library name="bin/QtCore4.dll" /> > <library name="bin/QtGui4.dll" /> > <library name="bin/QtSql4.dll" /> > <library name="bin/QtSvg4.dll" /> > <library name="bin/QtNetwork4.dll" /> > <library name="bin/QtXml4.dll" /> > <library name="bin/qtjambi.dll" /> > <library name="bin/com_trolltech_qt_core.dll" /> > <library name="bin/com_trolltech_qt_gui.dll" /> > <library name="bin/com_trolltech_qt_sql.dll" /> > <library name="bin/com_trolltech_qt_svg.dll" /> > <library name="bin/com_trolltech_qt_network.dll"/> > <library name="bin/com_trolltech_qt_xml.dll" /> > <library name="bin/com_trolltech_sketchtool.dll" /> > > </qtjambi-deploy> > > > > Jar execution output: > > java -jar sketcher.jar > Exception in thread "main" java.lang.ExceptionInInitializerError > at > com.trolltech.sketchtool.appSketchTool.<clinit>(appSketchTool.java:11) > at JambiApp.main(JambiApp.java:11) > Caused by: java.lang.RuntimeException: Loading library failed, progress > so far: > Unpacking .jar file: 'sketcher.jar' > Checking Archive 'sketcher.jar' > - cache key='sketcher' > - adding 'mingwm10.dll' to library map > - library: name='bin/mingwm10.dll', > - adding 'QtCore4.dll' to library map > - library: name='bin/QtCore4.dll', > - adding 'QtGui4.dll' to library map > - library: name='bin/QtGui4.dll', > - adding 'QtSql4.dll' to library map > - library: name='bin/QtSql4.dll', > - adding 'QtSvg4.dll' to library map > - library: name='bin/QtSvg4.dll', > - adding 'QtNetwork4.dll' to library map > - library: name='bin/QtNetwork4.dll', > - adding 'QtXml4.dll' to library map > - library: name='bin/QtXml4.dll', > - adding 'qtjambi.dll' to library map > - library: name='bin/qtjambi.dll', > - adding 'com_trolltech_qt_core.dll' to library map > - library: name='bin/com_trolltech_qt_core.dll', > - adding 'com_trolltech_qt_gui.dll' to library map > - library: name='bin/com_trolltech_qt_gui.dll', > - adding 'com_trolltech_qt_sql.dll' to library map > - library: name='bin/com_trolltech_qt_sql.dll', > - adding 'com_trolltech_qt_svg.dll' to library map > - library: name='bin/com_trolltech_qt_svg.dll', > - adding 'com_trolltech_qt_network.dll' to library map > - library: name='bin/com_trolltech_qt_network.dll', > - adding 'com_trolltech_qt_xml.dll' to library map > - library: name='bin/com_trolltech_qt_xml.dll', > - adding 'com_trolltech_sketchtool.dll' to library map > - library: name='bin/com_trolltech_sketchtool.dll', > - using cache directory: > 'C:\DOCUME~1\gtt5\LOCALS~1\Temp\QtJambi_gtt5_x86_4.5.2 > _01_sketcher' > - cache directory exists > Loading library: 'QtCore4.dll'... > - using deployment spec > - ok! > Loading library: 'qtjambi.dll'... > - using deployment spec > - ok! > Loading library: 'QtCore4.dll'... > - already loaded, skipping... > Loading library: 'com_trolltech_qt_core.dll'... > - using deployment spec > - ok! > Loading library: 'QtGui4.dll'... > - using deployment spec > - ok! > Loading library: 'com_trolltech_qt_gui.dll'... > - using deployment spec > - ok! > Loading library: 'com_trolltech_sketchtool.dll'... > - using deployment spec > > at > com.trolltech.qt.internal.NativeLibraryManager.loadNativeLibrary(Nati > veLibraryManager.java:431) > at > com.trolltech.qt.internal.NativeLibraryManager.loadLibrary(NativeLibr > aryManager.java:325) > at com.trolltech.qt.Utilities.loadJambiLibrary(Utilities.java:144) > at > com.trolltech.sketchtool.QtJambi_LibraryInitializer.<clinit>(QtJambi_ > LibraryInitializer.java:6) > ... 2 more > Caused by: java.lang.UnsatisfiedLinkError: C:\Documents and > Settings\gtt5\Local > Settings\Temp\QtJambi_gtt5_x86_4.5.2_01_sketcher\bin\com_trolltech_sketchtool.dl > l: Can't find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1699) > at java.lang.Runtime.load0(Runtime.java:770) > at java.lang.Runtime.load(Runtime.java:758) > at > com.trolltech.qt.internal.NativeLibraryManager.loadLibrary_helper(Nat > iveLibraryManager.java:458) > at > com.trolltech.qt.internal.NativeLibraryManager.loadNativeLibrary(Nati > veLibraryManager.java:426) > ... 5 more > > After execution all the libraries can be found in the cache directory. > > > > I've been fighting with this for a while now, so any help would be > greatly appreciated! > > Thanks, > -Greg > > > _______________________________________________ > Qt-jambi-interest mailing list > [email protected] > http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest > _______________________________________________ Qt-jambi-interest mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest
